diff bmp.c @ 4109:a90490a13ac4 libavcodec

coded line size is a multiple of 4
author mru
date Mon, 30 Oct 2006 20:43:07 +0000
parents c8c591fe26f8
children 5187883df562
line wrap: on
line diff
--- a/bmp.c	Mon Oct 30 18:05:35 2006 +0000
+++ b/bmp.c	Mon Oct 30 20:43:07 2006 +0000
@@ -177,7 +177,8 @@
     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",