OSDN Git Service

tiff: fix linesize for mono-white/black formats.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Mon, 9 May 2011 20:11:57 +0000 (22:11 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 5 Jun 2011 10:49:14 +0000 (12:49 +0200)
Fix decoding of file Test_1bpp.tif

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/tiff.c

index bea3532..eaaeb84 100644 (file)
@@ -105,7 +105,7 @@ static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src,
 static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){
     int c, line, pixels, code;
     const uint8_t *ssrc = src;
-    int width = s->width * s->bpp >> 3;
+    int width = ((s->width * s->bpp) + 7) >> 3;
 #if CONFIG_ZLIB
     uint8_t *zbuf; unsigned long outlen;