Commit 6f2054c5 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Fix linesize for bmp with bitdepth < 8.

Fixes ticket #751.
parent 2c82ab94
......@@ -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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment