[FFmpeg-devel] [PATCH] tiff: support zlib with inverted FillOrder

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Dec 8 19:34:11 CET 2012


Piotr Bandurski <ami_stuff <at> o2.pl> writes:

> +  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]];

?

Carl Eugen



More information about the ffmpeg-devel mailing list