[FFmpeg-cvslog] Fix linesize for bmp with bitdepth < 8.

Carl Eugen Hoyos git at videolan.org
Thu Dec 15 19:25:03 CET 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Dec 15 19:23:07 2011 +0100| [6f2054c589a467b7eaa0c4383c29fcced1280265] | committer: Carl Eugen Hoyos

Fix linesize for bmp with bitdepth < 8.

Fixes ticket #751.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f2054c589a467b7eaa0c4383c29fcced1280265
---

 libavcodec/bmp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index e97f6ed..419c3fa 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -206,7 +206,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 + 31) / 8) & ~3;
 
     if(n * avctx->height > dsize && comp != BMP_RLE4 && comp != BMP_RLE8){
         av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",



More information about the ffmpeg-cvslog mailing list