OSDN Git Service

tiff: add support for inverted FillOrder for uncompressed data
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Mon, 9 May 2011 19:59:20 +0000 (21:59 +0200)
committerDiego Biurrun <diego@biurrun.de>
Wed, 11 May 2011 11:55:44 +0000 (13:55 +0200)
Fix decoding of file b.tif, trac issue #168.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavcodec/tiff.c

index 3cc3a42..1ec78a7 100644 (file)
@@ -170,7 +170,13 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
         }
         switch(s->compr){
         case TIFF_RAW:
-            memcpy(dst, src, width);
+            if (!s->fill_order) {
+                memcpy(dst, src, width);
+            } else {
+                int i;
+                for (i = 0; i < width; i++)
+                    dst[i] = av_reverse[src[i]];
+            }
             src += width;
             break;
         case TIFF_PACKBITS: