On 2016-10-11 at 16:27, Michael Niedermayer wrote:
<snip>

> > +    for (i=0; i<p->buf_size-5; i++) {
> > +        soc = AV_RB16(p->buf + i);
> > +        if (soc == JPEG2000_SOC ) {
> > +            marker = AV_RB16(p->buf + i + 2);
> > +            marker_size = AV_RB16(p->buf + i + 4);
> > +            if (marker == JPEG2000_SIZ) {
> > +                i += marker_size + 2;
> > +                marker_marker = AV_RB8(p->buf + i + 2);
> 
> missing overflow and out of array checks

Ah, when I cleaned up the patch I removed the code, my bad.

> also the img2 demuxer for mjpeg2000 from img2dec.c does not work
> for this ?

It does work if I:
1) modify j2k_probe to not only check the first 4 bytes
2) hange the score return to be less than that of mpegts.
3) Add j2k_pipe to fmt_id_type[] in libavf/utils.c

I'm a bit worried about number 2. Increasing the score of mpegts might be a
better idea, but I am very afraid of touching any of that.

Is there a better way?
-- 
Ståle Kristoffersen
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to