mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed buffer overflow
This commit is contained in:
parent
fc230c8671
commit
ee3822f24b
|
@ -841,7 +841,11 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg)
|
||||||
queue(call->j_buf, _msg);
|
queue(call->j_buf, _msg);
|
||||||
|
|
||||||
int success = 0, dec_size;
|
int success = 0, dec_size;
|
||||||
int frame_size = 960;
|
|
||||||
|
ToxAvCSettings csettings;
|
||||||
|
toxav_get_peer_csettings(av, call_index, 0, &csettings);
|
||||||
|
|
||||||
|
int frame_size = 10000; /* FIXME: not static? */
|
||||||
int16_t dest[frame_size];
|
int16_t dest[frame_size];
|
||||||
|
|
||||||
while ((_msg = dequeue(call->j_buf, &success)) || success == 2) {
|
while ((_msg = dequeue(call->j_buf, &success)) || success == 2) {
|
||||||
|
@ -858,10 +862,11 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( av->audio_callback )
|
if ( av->audio_callback )
|
||||||
av->audio_callback(av, call_index, dest, frame_size);
|
av->audio_callback(av, call_index, dest, dec_size);
|
||||||
else
|
else
|
||||||
LOGGER_WARNING("Audio packet dropped due to missing callback!");
|
LOGGER_WARNING("Audio packet dropped due to missing callback!");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
uint8_t *packet = _msg->data;
|
uint8_t *packet = _msg->data;
|
||||||
int recved_size = _msg->length;
|
int recved_size = _msg->length;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user