From 743311a1b080fd015edd69c0e4d6a3db3c584954 Mon Sep 17 00:00:00 2001 From: Måns Rullgård Date: Mon, 30 Oct 2006 20:43:07 +0000 Subject: 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(-) (limited to 'libavcodec/bmp.c') 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", -- cgit v1.2.3