[FFmpeg-devel] [PATCH] IFF PBM/ILBM decoder

pross at xvid.org pross
Mon Feb 1 13:33:30 CET 2010


On Thu, Jan 28, 2010 at 09:06:43PM +0100, Michael Niedermayer wrote:
> On Wed, Jan 27, 2010 at 10:46:14PM +1100, pross at xvid.org wrote:
> > Hi, the war against Electronic Arts formats continues.
> > 
> > samples: /Mplayer/incoming/lbm
> >          http://samples.mplayerhq.hu/image-samples/ASH.LBM
> > 
> > Some identing cleanup is required after applying this patch.
> > 
> > -- Peter
> > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
> 
> [..]
> [...]

> > +    for(y = 0; y < avctx->height ; y++ ) {
> > +        uint8_t *row = &frame->data[0][ y*frame->linesize[0] ];
> > +        if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved
> > +            memset(row, 0, avctx->width);
> > +            for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
> > +                for(x = 0; x < planewidth && buf < buf_end; ) {
> > +                    char value = *buf++;
> > +                    int length;
> > +                    if (value >= 0) {
> > +                        length = value + 1;
> > +                        imemcpy(row, buf, x, avctx->bits_per_coded_sample, plane, FFMIN(length, buf_end-buf));
> > +                        buf += length;
> > +                    } else if (value > -128) {
> > +                        length = -value + 1;
> > +                        imemset(row, *buf++, x, avctx->bits_per_coded_sample, plane, length);
> 
> these look like they are missing output buffer size checks

Fixed.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-bitmaps-r2.diff
Type: text/x-diff
Size: 15566 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100201/a69f9d04/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100201/a69f9d04/attachment.pgp>



More information about the ffmpeg-devel mailing list