Commit 73840bbe authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/diracdec: Check ff_set_dimensions() for failure

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e839db22
...@@ -1989,7 +1989,12 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int ...@@ -1989,7 +1989,12 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
return ret; return ret;
} }
ff_set_dimensions(avctx, dsh->width, dsh->height); ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
if (ret < 0) {
av_freep(&dsh);
return ret;
}
ff_set_sar(avctx, dsh->sample_aspect_ratio); ff_set_sar(avctx, dsh->sample_aspect_ratio);
avctx->pix_fmt = dsh->pix_fmt; avctx->pix_fmt = dsh->pix_fmt;
avctx->color_range = dsh->color_range; avctx->color_range = dsh->color_range;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment