summaryrefslogtreecommitdiff
path: root/libavcodec/bmp.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-09-23 08:32:18 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-09-23 08:32:18 +0000
commita79cae798a8a5c41b612c7effe0c34124de421db (patch)
tree665ffe937aadd160bff5913ce12c620d306dfa2a /libavcodec/bmp.c
parent26d3e4d3abd341ebb9bbdf7bbafc2aa0f33f5a53 (diff)
Calculate line size correctly for bit depths < 8
Originally committed as revision 15388 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bmp.c')
-rw-r--r--libavcodec/bmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index ff34ab75f8..6f815e6c23 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -175,7 +175,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) / 8 + 3) & ~3;
if(n * avctx->height > dsize){
av_log(avctx, AV_LOG_ERROR, "not enough data (%d < %d)\n",