diff options
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 5e320bdeae..8d8bc98ed0 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1195,6 +1195,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; uint8_t old_permutation[64]; + int ret; if ((s1->mpeg_enc_ctx_allocated == 0) || avctx->coded_width != s->width || @@ -1217,7 +1218,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if ((s->width == 0) || (s->height == 0)) return -2; - avcodec_set_dimensions(avctx, s->width, s->height); + ret = ff_set_dimensions(avctx, s->width, s->height); + if (ret < 0) + return ret; + if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { avctx->rc_max_rate = s->bit_rate; } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && |