Mercurial > libavcodec.hg
comparison tiff.c @ 4188:57b22f48a6a6 libavcodec
Decoder can decode many ZLib-packed strips
author | kostya |
---|---|
date | Mon, 13 Nov 2006 11:27:36 +0000 |
parents | 46f12596304f |
children | 405f8395eedc |
comparison
equal
deleted
inserted
replaced
4187:46f12596304f | 4188:57b22f48a6a6 |
---|---|
108 #ifdef CONFIG_ZLIB | 108 #ifdef CONFIG_ZLIB |
109 uint8_t *zbuf; unsigned long outlen; | 109 uint8_t *zbuf; unsigned long outlen; |
110 | 110 |
111 if(s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE){ | 111 if(s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE){ |
112 outlen = width * lines; | 112 outlen = width * lines; |
113 if(lines != s->height){ | |
114 av_log(s->avctx, AV_LOG_ERROR, "This decoder won't decode ZLib-packed TIFF with %i lines per strip\n", lines); | |
115 return -1; | |
116 } | |
117 zbuf = av_malloc(outlen); | 113 zbuf = av_malloc(outlen); |
118 if(uncompress(zbuf, &outlen, src, size) != Z_OK){ | 114 if(uncompress(zbuf, &outlen, src, size) != Z_OK){ |
119 av_log(s->avctx, AV_LOG_ERROR, "Uncompressing failed (%lu of %lu)\n", outlen, (unsigned long)width * lines); | 115 av_log(s->avctx, AV_LOG_ERROR, "Uncompressing failed (%lu of %lu)\n", outlen, (unsigned long)width * lines); |
120 av_free(zbuf); | 116 av_free(zbuf); |
121 return -1; | 117 return -1; |