aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bmp.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-15 19:23:07 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 18:25:03 +0100
commit56e2190e1095d0f76a8b2b05f492fae476ef043a (patch)
tree84310bd755b48aaebb63a42cedad3256694ce6b2 /libavcodec/bmp.c
parent54aa78adaa3b3c6863760cf1467c4a450dbdedce (diff)
downloadffmpeg-56e2190e1095d0f76a8b2b05f492fae476ef043a.tar.gz
Fix linesize for bmp with bitdepth < 8.
Fixes ticket #751. (cherry picked from commit 6f2054c589a467b7eaa0c4383c29fcced1280265) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/bmp.c')
-rw-r--r--libavcodec/bmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index e97f6ed67c..419c3fa197 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",