summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-02-07 02:08:36 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-02-07 02:08:36 +0000
commitd8c2efac4b89a60a9f80ec3e5f38c0e2cf345c66 (patch)
treed4dab47f5ef7ade7c1e3ef77237e0d266c840831 /libavcodec
parenta861d4d7f3a715fe33da2d2742b5d75a5e02b6ba (diff)
width or height %16 != 0 bugfix
Originally committed as revision 287 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mjpeg.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 08281a5014..4c4df7cb87 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -620,13 +620,11 @@ static int mjpeg_decode_sof0(MJpegDecodeContext *s,
}
for(i=0;i<nb_components;i++) {
- int w, h, hh, vv;
- hh = s->h_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;