From d70b859084b2a8fced2f13d6618684d3b2cd9948 Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 28 Jun 2023 11:42:22 +0600 Subject: 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 --- video/out/vo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'video/out') diff --git a/video/out/vo.c b/video/out/vo.c index 40079049f8..c53cec36a1 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -1438,10 +1438,8 @@ struct vo_frame *vo_frame_ref(struct vo_frame *frame) struct vo_frame *new = talloc_ptrtype(NULL, new); talloc_set_destructor(new, destroy_frame); *new = *frame; - for (int n = 0; n < frame->num_frames; n++) { + for (int n = 0; n < frame->num_frames; n++) new->frames[n] = mp_image_new_ref(frame->frames[n]); - MP_HANDLE_OOM(new->frames[n]); - } new->current = new->num_frames ? new->frames[0] : NULL; return new; } -- cgit v1.2.3