summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/mp_image.c')
-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.