various: replace if + abort() with MP_HANDLE_OOM()

MP_HANDLE_OOM also aborts but calls assert() first, which
will result in an useful message if compiled in debug mode.
This commit is contained in:
sfan5
2023-01-10 18:59:21 +01:00
parent b6b8380518
commit 7b03cd367d
16 changed files with 24 additions and 48 deletions

View File

@@ -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;
}