changeset 7908:dc825905f93f libavcodec

Calculate line size correctly for bit depths < 8
author kostya
date Tue, 23 Sep 2008 08:32:18 +0000
parents 8eb69709a934
children 9fd3f57e4c16
files bmp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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",