From d8c2efac4b89a60a9f80ec3e5f38c0e2cf345c66 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 7 Feb 2002 02:08:36 +0000 Subject: [PATCH] width or height %16 != 0 bugfix Originally committed as revision 287 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mjpeg.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 08281a501..4c4df7cb8 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -620,13 +620,11 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s, } for(i=0;ih_max / s->h_count[i]; - vv = s->v_max / s->v_count[i]; - w = (s->width + 8 * hh - 1) / (8 * hh); - h = (s->height + 8 * vv - 1) / (8 * vv); - w = w * 8; - h = h * 8; + int w, h; + w = (s->width + 8 * s->h_max - 1) / (8 * s->h_max); + h = (s->height + 8 * s->v_max - 1) / (8 * s->v_max); + w = w * 8 * s->h_count[i]; + h = h * 8 * s->v_count[i]; if (s->interlaced) w *= 2; s->linesize[i] = w; -- 2.11.0