mp_image: abort on av_buffer_ref() failure

this changes mp_image_new_ref() to handle allocation failure itself
instead of doing it at its many call-sites (some of which never checked
for failure at all).

also remove MP_HANDLE_OOM() from the call sites since this is not
necessary anymore.

not all the call-sites have been touched, since some of the caller might
be relying on `mp_image_new_ref(NULL)` returning NULL.

Fixes: https://github.com/mpv-player/mpv/issues/11840
This commit is contained in:
NRK
2023-06-28 11:42:22 +06:00
committed by Philip Langdale
parent 2f220c6286
commit d70b859084
4 changed files with 12 additions and 24 deletions

View File

@@ -548,7 +548,6 @@ struct sub_bitmaps *sub_bitmaps_copy(struct sub_bitmap_copy_cache **p_cache,
assert(in->packed && in->packed->bufs[0]);
res->packed = mp_image_new_ref(res->packed);
MP_HANDLE_OOM(res->packed);
talloc_steal(res, res->packed);
res->parts = NULL;