comparison tiff.c @ 10299:a1654cd1b5b9 libavcodec

Do not compile ZLib data uncompressing function in TIFF decoder when ZLib is not present. Patch by Martin Storsj ($firstname <at> $firstname <dot> two first letters of $lastname)
author kostya
date Sun, 27 Sep 2009 09:43:11 +0000
parents a919d9583abd
children 8a49525f2b1e
comparison
equal deleted inserted replaced
10298:9699e4499f2d 10299:a1654cd1b5b9
73 case TIFF_LONG : return tget_long (p, le); 73 case TIFF_LONG : return tget_long (p, le);
74 default : return -1; 74 default : return -1;
75 } 75 }
76 } 76 }
77 77
78 #if CONFIG_ZLIB
78 static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src, int size) 79 static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src, int size)
79 { 80 {
80 z_stream zstream; 81 z_stream zstream;
81 int zret; 82 int zret;
82 83
93 zret = inflate(&zstream, Z_SYNC_FLUSH); 94 zret = inflate(&zstream, Z_SYNC_FLUSH);
94 inflateEnd(&zstream); 95 inflateEnd(&zstream);
95 *len = zstream.total_out; 96 *len = zstream.total_out;
96 return zret == Z_STREAM_END ? Z_OK : zret; 97 return zret == Z_STREAM_END ? Z_OK : zret;
97 } 98 }
99 #endif
98 100
99 static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){ 101 static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){
100 int c, line, pixels, code; 102 int c, line, pixels, code;
101 const uint8_t *ssrc = src; 103 const uint8_t *ssrc = src;
102 int width = s->width * s->bpp >> 3; 104 int width = s->width * s->bpp >> 3;