]> git.sesse.net Git - ffmpeg/commitdiff
vf_colorspace: Check av_frame_copy_props() return value
authorVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 25 Aug 2016 23:14:57 +0000 (19:14 -0400)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 27 Aug 2016 11:08:43 +0000 (13:08 +0200)
This function can potentially allocate memory.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_colorspace.c

index 3d39f13d1e9459e5409a641f0c9ef7e5f2cd3ea8..bf51c83389968863a6c03db722439496facd4012 100644 (file)
@@ -861,7 +861,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
         av_frame_free(&in);
         return AVERROR(ENOMEM);
     }
-    av_frame_copy_props(out, in);
+    res = av_frame_copy_props(out, in);
+    if (res < 0) {
+        av_frame_free(&in);
+        return res;
+    }
 
     out->color_primaries = s->user_prm == AVCOL_PRI_UNSPECIFIED ?
                            default_prm[FFMIN(s->user_all, CS_NB)] : s->user_prm;