summaryrefslogtreecommitdiff
path: root/libavfilter/vf_hflip.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-03 18:54:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-03 19:15:46 +0200
commite43a0a232dbf6d3c161823c2e07c52e76227a1bc (patch)
tree6ccf4fedf12be91e9de6f73fee41d202612916b5 /libavfilter/vf_hflip.c
parentbc4e7985628134496104e32f37f811aab4f68c55 (diff)
avfilter: fix plane validity checks
Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_hflip.c')
-rw-r--r--libavfilter/vf_hflip.c2
1 files changed, 1 insertions, 1 deletions
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];