summaryrefslogtreecommitdiffstats
path: root/video/image_writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/image_writer.c')
-rw-r--r--video/image_writer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/video/image_writer.c b/video/image_writer.c
index f769fd9f27..c6da4ff7e5 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -289,6 +289,10 @@ int write_image(struct mp_image *image, const struct image_writer_opts *opts,
// it's unclear what colorspace/levels the target wants
if (image->imgfmt != destfmt || is_anamorphic) {
struct mp_image *dst = mp_image_alloc(destfmt, d_w, d_h);
+ if (!dst) {
+ mp_err(log, "Out of memory.\n");
+ return 0;
+ }
mp_image_copy_attributes(dst, image);
mp_image_swscale(dst, image, mp_sws_hq_flags);