aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-15 01:33:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-15 01:38:02 +0200
commit6beea6f017f5d0be06fa9dfdea921275586eec55 (patch)
tree565a3509cb94ca9e705d4457f9ec41adac04712b /libavcodec
parent04b0dda853198980a14158809e560ea9ca9d7e33 (diff)
downloadffmpeg-6beea6f017f5d0be06fa9dfdea921275586eec55.tar.gz
avcodec/tiff: fix odd dimensioned yuv
Fixes Ticket3893 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/tiff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 0352639d2f..6e2096fd69 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -510,7 +510,9 @@ static int tiff_unpack_strip(TiffContext *s, AVFrame *p, uint8_t *dst, int strid
}
dst = s->yuv_line;
stride = 0;
- width = s->width * s->subsampling[1] + 2*(s->width / s->subsampling[0]);
+
+ width = (s->width - 1) / s->subsampling[0] + 1;
+ width = width * s->subsampling[0] * s->subsampling[1] + 2*width;
av_assert0(width <= bytes_per_row);
av_assert0(s->bpp == 24);
}