summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2016-08-25 19:14:57 -0400
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-27 13:08:43 +0200
commit6648da359114696351db7e7468f0769a7d61c387 (patch)
treefbbf6647dbb2ae54eb32fce4db4940b7ed35c8b5 /libavfilter
parentc75273310cf1becffee79bab0e2bba0b1606afb7 (diff)
vf_colorspace: Check av_frame_copy_props() return value
This function can potentially allocate memory. Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_colorspace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 3d39f13d1e..bf51c83389 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -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;