Commit d8c2efac authored by Michael Niedermayer's avatar Michael Niedermayer

width or height %16 != 0 bugfix

Originally committed as revision 287 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a861d4d7
...@@ -620,13 +620,11 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s, ...@@ -620,13 +620,11 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s,
} }
for(i=0;i<nb_components;i++) { for(i=0;i<nb_components;i++) {
int w, h, hh, vv; int w, h;
hh = s->h_max / s->h_count[i]; w = (s->width + 8 * s->h_max - 1) / (8 * s->h_max);
vv = s->v_max / s->v_count[i]; h = (s->height + 8 * s->v_max - 1) / (8 * s->v_max);
w = (s->width + 8 * hh - 1) / (8 * hh); w = w * 8 * s->h_count[i];
h = (s->height + 8 * vv - 1) / (8 * vv); h = h * 8 * s->v_count[i];
w = w * 8;
h = h * 8;
if (s->interlaced) if (s->interlaced)
w *= 2; w *= 2;
s->linesize[i] = w; s->linesize[i] = w;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment