From 743311a1b080fd015edd69c0e4d6a3db3c584954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Mon, 30 Oct 2006 20:43:07 +0000 Subject: [PATCH] coded line size is a multiple of 4 Originally committed as revision 6844 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/bmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 3034f9b8d3..2a4d83393e 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -177,7 +177,8 @@ static int bmp_decode_frame(AVCodecContext *avctx, buf += hsize; dsize = buf_size - hsize; - n = avctx->width * (depth / 8); + /* Line size in file multiple of 4 */ + n = (avctx->width * (depth / 8) + 3) & ~3; if(n * avctx->height > dsize){ av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",