]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Calculate line size correctly for bit depths < 8
authorkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 23 Sep 2008 08:32:18 +0000 (08:32 +0000)
committerkostya <kostya@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 23 Sep 2008 08:32:18 +0000 (08:32 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15388 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/bmp.c

index ff34ab75f8d8c6dae2de3b18bd701c9fe2c4a65f..6f815e6c233a2f4c0de1c0adbebaea9e0b435cd4 100644 (file)
@@ -175,7 +175,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
     dsize = buf_size - hsize;
 
     /* Line size in file multiple of 4 */
-    n = (avctx->width * (depth / 8) + 3) & ~3;
+    n = ((avctx->width * depth) / 8 + 3) & ~3;
 
     if(n * avctx->height > dsize){
         av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",