[FFmpeg-cvslog] r16265 - trunk/libavcodec/tiff.c

kostya subversion
Mon Dec 22 07:39:31 CET 2008


Author: kostya
Date: Mon Dec 22 07:39:31 2008
New Revision: 16265

Log:
Calculate line size variable correctly for lower bitdepths and use it for raw data copying

Modified:
   trunk/libavcodec/tiff.c

Modified: trunk/libavcodec/tiff.c
==============================================================================
--- trunk/libavcodec/tiff.c	(original)
+++ trunk/libavcodec/tiff.c	Mon Dec 22 07:39:31 2008
@@ -74,7 +74,7 @@ static int tget(const uint8_t **p, int t
 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 / 8);
+    int width = s->width * s->bpp >> 3;
 #ifdef CONFIG_ZLIB
     uint8_t *zbuf; unsigned long outlen;
 
@@ -109,8 +109,8 @@ static int tiff_unpack_strip(TiffContext
         }
         switch(s->compr){
         case TIFF_RAW:
-            memcpy(dst, src, s->width * (s->bpp / 8));
-            src += s->width * (s->bpp / 8);
+            memcpy(dst, src, width);
+            src += width;
             break;
         case TIFF_PACKBITS:
             for(pixels = 0; pixels < width;){




More information about the ffmpeg-cvslog mailing list