diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 67c39687..f337217c 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -509,4 +509,4 @@ int main(int argc, char *argv[]) srunner_free(test_runner); return number_failed; -} \ No newline at end of file +} diff --git a/toxav/phone.c b/toxav/phone.c index f6e7d7a6..2b33f7e9 100755 --- a/toxav/phone.c +++ b/toxav/phone.c @@ -559,9 +559,9 @@ void *decode_video_thread(void *arg) while (_phone->running_decvid) { //recved_size = toxav_recv_rtp_payload(_phone->av, TypeVideo, dest); //if (recved_size) { - vpx_image_t *image; + vpx_image_t *image = NULL; - if (toxav_recv_video(_phone->av, &image) == 0) { + if (toxav_recv_video(_phone->av, &image) == 0 && image) { //memcpy(dec_video_packet.data, dest, recved_size); //dec_video_packet.size = recved_size; diff --git a/toxav/rtp.c b/toxav/rtp.c index 42c9480c..b52840c1 100755 --- a/toxav/rtp.c +++ b/toxav/rtp.c @@ -752,6 +752,7 @@ int rtp_send_msg ( RTPSession *session, Messenger *messenger, const uint8_t *dat /*if ( full_length != sendpacket ( messenger->net, *((IP_Port*) &session->dest), _send_data, full_length) ) {*/ if ( full_length != send_custom_user_packet(messenger, session->dest, _send_data, full_length) ) { /*fprintf(stderr, "Rtp error: %s\n", strerror(errno));*/ + rtp_free_msg ( session, msg ); return -1; }