summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-08 16:10:04 +0100
committerwm4 <wm4@nowhere>2014-11-08 16:10:04 +0100
commit4235aab8974ef4e72e2b7ccdc7d8dee3750d3333 (patch)
tree034eb505d1c2395bda7b79ffc0851358cc29a2bd /video
parent33b57f55573e658b3af6c6e8ff3188c8f959e82e (diff)
downloadmpv-4235aab8974ef4e72e2b7ccdc7d8dee3750d3333.tar.bz2
mpv-4235aab8974ef4e72e2b7ccdc7d8dee3750d3333.tar.xz
mp_image: check memory allocation
Diffstat (limited to 'video')
-rw-r--r--video/mp_image.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 860a47ea6f..1ba7a4ee2c 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -689,6 +689,10 @@ struct AVFrame *mp_image_to_av_frame_and_unref(struct mp_image *img)
if (!new_ref)
return NULL;
AVFrame *frame = av_frame_alloc();
+ if (!frame) {
+ talloc_free(new_ref);
+ return NULL;
+ }
mp_image_copy_fields_to_av_frame(frame, new_ref);
// Caveat: if img has shared references, and all other references disappear
// at a later point, the AVFrame will still be read-only.