summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-13 22:00:08 +0100
committerwm4 <wm4@nowhere>2014-12-13 22:00:08 +0100
commit291ae3d65991a8f70ac44167236823331d0ec97c (patch)
treef341ab09af8eae22999d4c19411be72ade0be825 /video/mp_image.c
parent5b618ef62976370ca184839d0bd8efd615e9f20e (diff)
downloadmpv-291ae3d65991a8f70ac44167236823331d0ec97c.tar.bz2
mpv-291ae3d65991a8f70ac44167236823331d0ec97c.tar.xz
mp_image: check for malloc failure
Or rather, the only reason av_buffer_create() can fail is a malloc failure.
Diffstat (limited to 'video/mp_image.c')
-rw-r--r--video/mp_image.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 66a046c52f..6c969cb3a4 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -724,6 +724,8 @@ struct AVFrame *mp_image_to_av_frame_and_unref(struct mp_image *img)
void *ptr = new_ref->planes[n];
size_t size = new_ref->stride[n] * new_ref->h;
frame->buf[n] = av_buffer_create(ptr, size, free_img, dummy_ref, flags);
+ if (!frame->buf[n])
+ abort();
}
talloc_free(new_ref);
return frame;