diff options
author | iphydf <iphydf@users.noreply.github.com> | 2020-05-03 01:09:06 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2020-05-03 14:13:48 +0000 |
commit | 88b90c82259f86470cf6eba8684e8d9b4cd61bc3 (patch) | |
tree | 90e052389ffacec791019a096837a670e205b225 /toxav | |
parent | 7b758f66dbc550fa52ed66fd7f8b81f8ed37a94e (diff) |
Fix a bug in savedata loading when malloc fails.
Also added a bunch of asserts to tests where they don't check allocs.
Diffstat (limited to 'toxav')
-rw-r--r-- | toxav/toxav.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index 3dbe2cff..0ecf8259 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -755,7 +755,7 @@ bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t *pc | |||
755 | goto RETURN; | 755 | goto RETURN; |
756 | } | 756 | } |
757 | 757 | ||
758 | { /* Encode and send */ | 758 | { /* Encode and send */ |
759 | if (ac_reconfigure_encoder(call->audio, call->audio_bit_rate * 1000, sampling_rate, channels) != 0) { | 759 | if (ac_reconfigure_encoder(call->audio, call->audio_bit_rate * 1000, sampling_rate, channels) != 0) { |
760 | pthread_mutex_unlock(call->mutex_audio); | 760 | pthread_mutex_unlock(call->mutex_audio); |
761 | rc = TOXAV_ERR_SEND_FRAME_INVALID; | 761 | rc = TOXAV_ERR_SEND_FRAME_INVALID; |
@@ -896,7 +896,7 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u | |||
896 | 896 | ||
897 | // we start with I-frames (full frames) and then switch to normal mode later | 897 | // we start with I-frames (full frames) and then switch to normal mode later |
898 | 898 | ||
899 | { /* Encode */ | 899 | { /* Encode */ |
900 | vpx_image_t img; | 900 | vpx_image_t img; |
901 | img.w = 0; | 901 | img.w = 0; |
902 | img.h = 0; | 902 | img.h = 0; |
@@ -1323,7 +1323,7 @@ static bool call_prepare_transmission(ToxAVCall *call) | |||
1323 | /* Prepare bwc */ | 1323 | /* Prepare bwc */ |
1324 | call->bwc = bwc_new(av->m, av->tox, call->friend_number, callback_bwc, call, av->toxav_mono_time); | 1324 | call->bwc = bwc_new(av->m, av->tox, call->friend_number, callback_bwc, call, av->toxav_mono_time); |
1325 | 1325 | ||
1326 | { /* Prepare audio */ | 1326 | { /* Prepare audio */ |
1327 | call->audio = ac_new(av->toxav_mono_time, av->m->log, av, call->friend_number, av->acb, av->acb_user_data); | 1327 | call->audio = ac_new(av->toxav_mono_time, av->m->log, av, call->friend_number, av->acb, av->acb_user_data); |
1328 | 1328 | ||
1329 | if (!call->audio) { | 1329 | if (!call->audio) { |
@@ -1339,7 +1339,7 @@ static bool call_prepare_transmission(ToxAVCall *call) | |||
1339 | goto FAILURE; | 1339 | goto FAILURE; |
1340 | } | 1340 | } |
1341 | } | 1341 | } |
1342 | { /* Prepare video */ | 1342 | { /* Prepare video */ |
1343 | call->video = vc_new(av->toxav_mono_time, av->m->log, av, call->friend_number, av->vcb, av->vcb_user_data); | 1343 | call->video = vc_new(av->toxav_mono_time, av->m->log, av, call->friend_number, av->vcb, av->vcb_user_data); |
1344 | 1344 | ||
1345 | if (!call->video) { | 1345 | if (!call->video) { |