# HG changeset patch # User kostya # Date 1222158738 0 # Node ID dc825905f93fb7f6a82a060da01833d985d7c01c # Parent 8eb69709a934e321a560ab7900065b584cbc3f88 Calculate line size correctly for bit depths < 8 diff -r 8eb69709a934 -r dc825905f93f bmp.c --- a/bmp.c Mon Sep 22 20:46:52 2008 +0000 +++ b/bmp.c Tue Sep 23 08:32:18 2008 +0000 @@ -175,7 +175,7 @@ dsize = buf_size - hsize; /* Line size in file multiple of 4 */ - n = (avctx->width * (depth / 8) + 3) & ~3; + n = ((avctx->width * depth) / 8 + 3) & ~3; if(n * avctx->height > dsize){ av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",