From e43a0a232dbf6d3c161823c2e07c52e76227a1bc Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 3 Aug 2013 18:54:43 +0200 Subject: avfilter: fix plane validity checks Fixes out of array accesses Signed-off-by: Michael Niedermayer --- libavfilter/vf_hflip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavfilter/vf_hflip.c') diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index 7fc135fdfc..0a9bc2cc66 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -90,7 +90,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (av_pix_fmt_desc_get(inlink->format)->flags & AV_PIX_FMT_FLAG_PAL) memcpy(out->data[1], in->data[1], AVPALETTE_SIZE); - for (plane = 0; plane < 4 && in->data[plane]; plane++) { + for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) { const int width = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(inlink->w, s->hsub) : inlink->w; const int height = (plane == 1 || plane == 2) ? FF_CEIL_RSHIFT(inlink->h, s->vsub) : inlink->h; step = s->max_step[plane]; -- cgit v1.2.3