On Sat, Mar 19, 2016 at 05:42:40PM -0400, Vittorio Giovara wrote: > --- a/libavcodec/vc1dec.c > +++ b/libavcodec/vc1dec.c > @@ -314,7 +314,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx) > av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) > { > MpegEncContext *s = &v->s; > - int i; > + int i, ret = AVERROR(ENOMEM); > int mb_height = FFALIGN(s->mb_height, 2); > > /* Allocate mb bitplanes */ > @@ -371,7 +371,9 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) > v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1; > v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + > 1) + s->mb_stride * (mb_height + 1) * 2); > > - ff_intrax8_common_init(&v->x8,s); > + ret = ff_intrax8_common_init(&v->x8,s); > + if (ret < 0) > + goto error; > > if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == > AV_CODEC_ID_VC1IMAGE) { > for (i = 0; i < 4; i++) { > @@ -385,7 +387,7 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) > > error: > ff_vc1_decode_end(s->avctx); > - return AVERROR(ENOMEM); > + return ret; > }
Below the ff_intrax8_common_init() call is another malloc that relies on the return value being set differently. Diego _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel