[FFmpeg-devel] [PATCH] avcodec/imm4: improve decoding of some files

Timo Rothenpieler timo at rothenpieler.org
Mon Oct 22 14:17:35 EEST 2018


 > @@ -205,9 +206,26 @@ static int decode_blocks(AVCodecContext *avctx, 
GetBitContext *gb,
 >  static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, 
AVFrame *frame)
 >  {
 >      IMM4Context *s = avctx->priv_data;
 > -    int ret, x, y;
 > +    int ret, x, y, offset = 0;
 >
 > -    s->factor = intra_cb[s->sindex];
 > +    if (s->hi == 0) {
 > +        if (s->lo > 2)
 > +            return AVERROR_INVALIDDATA;
 > +        s->factor = intra_cb[s->lo];
 > +    } else {
 > +        if (s->hi == 1) {
 > +            s->factor = s->lo * 2;
 > +        } else {
 > +            s->factor = s->lo * 2;
 > +        }
 > +    }

This if-branch does not look like it does what it's intended to do.

 > @@ -244,9 +262,26 @@ static int decode_inter(AVCodecContext *avctx, 
GetBitContext *gb,
 >                          AVFrame *frame, AVFrame *prev)
 >  {
 >      IMM4Context *s = avctx->priv_data;
 > -    int ret, x, y;
 > +    int ret, x, y, offset = 0;
 >
 > -    s->factor = inter_cb[s->sindex];
 > +    if (s->hi == 0) {
 > +        if (s->lo > 2)
 > +            return AVERROR_INVALIDDATA;
 > +        s->factor = inter_cb[s->lo];
 > +    } else {
 > +        if (s->hi == 1) {
 > +            s->factor = s->lo * 2;
 > +        } else {
 > +            s->factor = s->lo * 2;
 > +        }
 > +    }

Same here

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4538 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181022/2c63b8aa/attachment.bin>


More information about the ffmpeg-devel mailing list