diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2016-11-15 02:53:47 -0500 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2016-11-20 20:32:48 -0500 |
commit | 44ac19693604cc693c9266ce64200a1cdcb86877 (patch) | |
tree | b46c9273e63bd9945118ecbaac870502da6289f6 /toxav/toxav.c | |
parent | a403c996b57224245096b493568374cb977a97db (diff) |
Fix NULL pointer dereference in log calls
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r-- | toxav/toxav.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index c0f64648..49058b8f 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -177,7 +177,7 @@ void toxav_kill(ToxAV *av) | |||
177 | pthread_mutex_lock(av->mutex); | 177 | pthread_mutex_lock(av->mutex); |
178 | 178 | ||
179 | /* To avoid possible deadlocks */ | 179 | /* To avoid possible deadlocks */ |
180 | while (av->msi && msi_kill(av->msi) != 0) { | 180 | while (av->msi && msi_kill(av->msi, av->m->log) != 0) { |
181 | pthread_mutex_unlock(av->mutex); | 181 | pthread_mutex_unlock(av->mutex); |
182 | pthread_mutex_lock(av->mutex); | 182 | pthread_mutex_lock(av->mutex); |
183 | } | 183 | } |
@@ -718,7 +718,7 @@ bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t *pc | |||
718 | goto END; | 718 | goto END; |
719 | } | 719 | } |
720 | 720 | ||
721 | if (rtp_send_data(call->audio.first, dest, vrc + sizeof(sampling_rate)) != 0) { | 721 | if (rtp_send_data(call->audio.first, dest, vrc + sizeof(sampling_rate), av->m->log) != 0) { |
722 | LOGGER_WARNING(av->m->log, "Failed to send audio packet"); | 722 | LOGGER_WARNING(av->m->log, "Failed to send audio packet"); |
723 | rc = TOXAV_ERR_SEND_FRAME_RTP_FAILED; | 723 | rc = TOXAV_ERR_SEND_FRAME_RTP_FAILED; |
724 | } | 724 | } |
@@ -815,7 +815,7 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u | |||
815 | 815 | ||
816 | while ((pkt = vpx_codec_get_cx_data(call->video.second->encoder, &iter))) { | 816 | while ((pkt = vpx_codec_get_cx_data(call->video.second->encoder, &iter))) { |
817 | if (pkt->kind == VPX_CODEC_CX_FRAME_PKT && | 817 | if (pkt->kind == VPX_CODEC_CX_FRAME_PKT && |
818 | rtp_send_data(call->video.first, (const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz) < 0) { | 818 | rtp_send_data(call->video.first, (const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz, av->m->log) < 0) { |
819 | 819 | ||
820 | pthread_mutex_unlock(call->mutex_video); | 820 | pthread_mutex_unlock(call->mutex_video); |
821 | LOGGER_WARNING(av->m->log, "Could not send video frame: %s\n", strerror(errno)); | 821 | LOGGER_WARNING(av->m->log, "Could not send video frame: %s\n", strerror(errno)); |