summaryrefslogtreecommitdiff
path: root/libavcodec/tiff.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2006-11-13 05:28:55 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2006-11-13 05:28:55 +0000
commitec8a152b6fbe2b06318c83839561191178748e1a (patch)
tree0d39f39162f01280b507c3943f1c274a41a6868b /libavcodec/tiff.c
parentffa0a3d6fee73c2458742389fa06267caa2b5c1d (diff)
Correctly detect 4-component images
Originally committed as revision 7002 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r--libavcodec/tiff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 57bdc37100..ee2627c8e8 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -242,11 +242,12 @@ static int tiff_decode_tag(TiffContext *s, uint8_t *start, uint8_t *buf, uint8_t
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;