[FFmpeg-devel] [PATCH] tiff: support zlib with invertedFillOrder

Piotr Bandurski ami_stuff at o2.pl
Sat Dec 8 20:24:18 CET 2012


Hi,

> > +  uint8_t *src2, *zbuf;
> 
> > -  ret = tiff_uncompress(zbuf, &outlen, src, size);
> > +  src2 = av_malloc((unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE);
> > +  if (!src2) {
> > +      av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
> > +      av_free(zbuf);
> > +      return AVERROR(ENOMEM);
> > +  }
> > +  if (!s->fill_order) {
> > +      memcpy(src2, src, size);
> 
> Sorry, I did not test but shouldn't this be:
> uint8_t *src2 = src;
> 
> ...
> 
> if (s->fill_order) {
>   src2 = av_malloc();
>   if (!src2) {
>     ...
>   }
>   memcpy();
>   for(...)
>     src2[i] = ff_reverse[src[i]];
> 
> ?

I think it should be as it is now (based on s->compr == TIFF_CCITT_RLE inverted case),
but please feel free to change anything before applying the patch if there is something
wrong in the code.

Regards



More information about the ffmpeg-devel mailing list