Fix linesize for bmp with bitdepth < 8.

Fixes ticket #751.
This commit is contained in:
Carl Eugen Hoyos 2011-12-15 19:23:07 +01:00
parent 2c82ab946b
commit 6f2054c589
1 changed files with 1 additions and 1 deletions

View File

@ -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",