forked from Green-Sky/tomato
Merge commit '8eb4892b4976e82e020d0e30dcf8f0705b76bb4e'
This commit is contained in:
2
external/toxcore/c-toxcore/toxav/msi.c
vendored
2
external/toxcore/c-toxcore/toxav/msi.c
vendored
@ -587,7 +587,7 @@ static MSICall *new_call(MSISession *session, uint32_t friend_number)
|
||||
session->calls_tail = friend_number;
|
||||
session->calls_head = friend_number;
|
||||
} else if (session->calls_tail < friend_number) { /* Appending */
|
||||
MSICall **tmp = (MSICall **)realloc(session->calls, sizeof(MSICall *) * (friend_number + 1));
|
||||
MSICall **tmp = (MSICall **)realloc(session->calls, (friend_number + 1) * sizeof(MSICall *));
|
||||
|
||||
if (tmp == nullptr) {
|
||||
free(rc);
|
||||
|
@ -106,8 +106,9 @@ uint16_t rb_size(const RingBuffer *b)
|
||||
uint16_t rb_data(const RingBuffer *b, void **dest)
|
||||
{
|
||||
uint16_t i;
|
||||
const uint16_t size = rb_size(b);
|
||||
|
||||
for (i = 0; i < rb_size(b); ++i) {
|
||||
for (i = 0; i < size; ++i) {
|
||||
dest[i] = b->data[(b->start + i) % b->size];
|
||||
}
|
||||
|
||||
|
2
external/toxcore/c-toxcore/toxav/toxav.c
vendored
2
external/toxcore/c-toxcore/toxav/toxav.c
vendored
@ -1284,7 +1284,7 @@ static ToxAVCall *call_new(ToxAV *av, uint32_t friend_number, Toxav_Err_Call *er
|
||||
av->calls_tail = friend_number;
|
||||
av->calls_head = friend_number;
|
||||
} else if (av->calls_tail < friend_number) { /* Appending */
|
||||
ToxAVCall **tmp = (ToxAVCall **)realloc(av->calls, sizeof(ToxAVCall *) * (friend_number + 1));
|
||||
ToxAVCall **tmp = (ToxAVCall **)realloc(av->calls, (friend_number + 1) * sizeof(ToxAVCall *));
|
||||
|
||||
if (tmp == nullptr) {
|
||||
pthread_mutex_destroy(call->toxav_call_mutex);
|
||||
|
Reference in New Issue
Block a user