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

Michael Niedermayer michaelni at gmx.at
Sat Dec 8 21:42:27 CET 2012


On Sat, Dec 08, 2012 at 08:24:18PM +0100, Piotr Bandurski wrote:
> 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.

i think carl meant that the memcpy can be avoided

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121208/c7bcc93a/attachment.asc>


More information about the ffmpeg-devel mailing list