changeset 4183:c70922cdf2ee libavcodec

Correctly detect 4-component images
author kostya
date Mon, 13 Nov 2006 05:28:55 +0000
parents 17d005bf07f2
children cfaa5d84641e
files tiff.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tiff.c	Mon Nov 13 05:15:55 2006 +0000
+++ b/tiff.c	Mon Nov 13 05:28:55 2006 +0000
@@ -242,11 +242,12 @@
         else{
             switch(type){
             case TIFF_BYTE:
-                s->bpp = (off & 0xFF) + ((off >> 8) & 0xFF) + ((off >> 16) & 0xFF);
+                s->bpp = (off & 0xFF) + ((off >> 8) & 0xFF) + ((off >> 16) & 0xFF) + ((off >> 24) & 0xFF);
                 break;
             case TIFF_SHORT:
             case TIFF_LONG:
-                s->bpp = tget(&buf, type, s->le) + tget(&buf, type, s->le) + tget(&buf, type, s->le);
+                s->bpp = 0;
+                for(i = 0; i < count; i++) s->bpp += tget(&buf, type, s->le);
                 break;
             default:
                 s->bpp = -1;