summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2014-07-27 01:24:28 +0200
committermannol <eniz_vukovic@hotmail.com>2014-07-27 01:24:28 +0200
commitee3822f24b14a76e6e1d833f521618f38bdc26b9 (patch)
tree292c9c027a50e97f47bff415e94125a9c483803f
parentfc230c86714eb05b69c4a8b9501332a8e32b3e49 (diff)
Fixed buffer overflow
-rw-r--r--toxav/toxav.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 47a94fba..c9e11e52 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -841,7 +841,11 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg)
841 queue(call->j_buf, _msg); 841 queue(call->j_buf, _msg);
842 842
843 int success = 0, dec_size; 843 int success = 0, dec_size;
844 int frame_size = 960; 844
845 ToxAvCSettings csettings;
846 toxav_get_peer_csettings(av, call_index, 0, &csettings);
847
848 int frame_size = 10000; /* FIXME: not static? */
845 int16_t dest[frame_size]; 849 int16_t dest[frame_size];
846 850
847 while ((_msg = dequeue(call->j_buf, &success)) || success == 2) { 851 while ((_msg = dequeue(call->j_buf, &success)) || success == 2) {
@@ -858,10 +862,11 @@ void toxav_handle_packet(RTPSession *_session, RTPMessage *_msg)
858 } 862 }
859 863
860 if ( av->audio_callback ) 864 if ( av->audio_callback )
861 av->audio_callback(av, call_index, dest, frame_size); 865 av->audio_callback(av, call_index, dest, dec_size);
862 else 866 else
863 LOGGER_WARNING("Audio packet dropped due to missing callback!"); 867 LOGGER_WARNING("Audio packet dropped due to missing callback!");
864 } 868 }
869
865 } else { 870 } else {
866 uint8_t *packet = _msg->data; 871 uint8_t *packet = _msg->data;
867 int recved_size = _msg->length; 872 int recved_size = _msg->length;