summaryrefslogtreecommitdiff
path: root/libavcodec/bmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/bmp.c')
-rw-r--r--libavcodec/bmp.c3
1 files changed, 2 insertions, 1 deletions
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",