diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/aframe.c | 6 | ||||
-rw-r--r-- | audio/decode/ad_spdif.c | 3 | ||||
-rw-r--r-- | audio/out/ao_lavc.c | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/audio/aframe.c b/audio/aframe.c index 9b0827f64c..cb6ea17be3 100644 --- a/audio/aframe.c +++ b/audio/aframe.c @@ -52,8 +52,7 @@ struct mp_aframe *mp_aframe_create(void) { struct mp_aframe *frame = talloc_zero(NULL, struct mp_aframe); frame->av_frame = av_frame_alloc(); - if (!frame->av_frame) - abort(); + MP_HANDLE_OOM(frame->av_frame); talloc_set_destructor(frame, free_frame); mp_aframe_reset(frame); return frame; @@ -701,8 +700,7 @@ int mp_aframe_pool_allocate(struct mp_aframe_pool *pool, struct mp_aframe *frame if (planes > AV_NUM_DATA_POINTERS) { av_frame->extended_data = av_calloc(planes, sizeof(av_frame->extended_data[0])); - if (!av_frame->extended_data) - abort(); + MP_HANDLE_OOM(av_frame->extended_data); } else { av_frame->extended_data = av_frame->data; } diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index 3b799660c1..decd97206d 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -169,8 +169,7 @@ static int init_filter(struct mp_filter *da, AVPacket *pkt) goto fail; void *buffer = av_mallocz(OUTBUF_SIZE); - if (!buffer) - abort(); + MP_HANDLE_OOM(buffer); lavf_ctx->pb = avio_alloc_context(buffer, OUTBUF_SIZE, 1, spdif_ctx, NULL, write_packet, NULL); if (!lavf_ctx->pb) { diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c index cb53407eb6..abeefeed27 100644 --- a/audio/out/ao_lavc.c +++ b/audio/out/ao_lavc.c @@ -210,8 +210,7 @@ static void encode(struct ao *ao, struct mp_aframe *af) double outpts = mp_aframe_get_pts(af); AVFrame *frame = mp_aframe_to_avframe(af); - if (!frame) - abort(); + MP_HANDLE_OOM(frame); frame->pts = rint(outpts * av_q2d(av_inv_q(encoder->time_base))); |