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

pross at xvid.org pross
Wed Feb 3 11:01:02 CET 2010


thanks for taking the time to review.

On Tue, Feb 02, 2010 at 07:06:06PM +0100, Michael Niedermayer wrote:
> On Mon, Feb 01, 2010 at 11:33:30PM +1100, pross at xvid.org wrote:
> > 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)
> > > 
> > > [..]
> > > [...]

> > +    int count = 2 << (avctx->bits_per_coded_sample - 1);

> > +    if (avctx->extradata_size < count * 3) {
> > +        av_log(avctx, AV_LOG_ERROR, "palette data underflow\n");
> > +        return AVERROR_INVALIDDATA;
> > +    }
> > +    for (i=0; i < count; i++) {
> > +        pal[i] = AV_RB24( avctx->extradata + i*3 );
> > +    }
> 
> what if count is bigger than 256 ?

should never happen. fixed.

> also maybe testing the decoder & demuxer with a fuzzer would be a
> good idea

done.

> > +    for(y = 0; y < avctx->height; y++ ) {
> > +        uint8_t *row = &frame->data[0][ y*frame->linesize[0] ];
> > +        memset(row, 0, avctx->width);
> > +        for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) {
> > +            imemcpy(row, buf, 0, avctx->bits_per_coded_sample, plane, planewidth);
> > +            buf += planewidth;
> > +        }
> 
> can this write outside the array if bits_per_coded_sample is > 8 ?

described above.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- 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/20100203/5ea7fee3/attachment.pgp>



More information about the ffmpeg-devel mailing list