mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/utils: Also free encoder extradata on avcodec_open2() error
It is owned by libavcodec for encoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
d1dcc20126
commit
b8e0ceda11
|
@ -1034,11 +1034,15 @@ free_and_end:
|
||||||
av_opt_free(avctx->priv_data);
|
av_opt_free(avctx->priv_data);
|
||||||
av_opt_free(avctx);
|
av_opt_free(avctx);
|
||||||
|
|
||||||
|
if (av_codec_is_encoder(avctx->codec)) {
|
||||||
#if FF_API_CODED_FRAME
|
#if FF_API_CODED_FRAME
|
||||||
FF_DISABLE_DEPRECATION_WARNINGS
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
av_frame_free(&avctx->coded_frame);
|
av_frame_free(&avctx->coded_frame);
|
||||||
FF_ENABLE_DEPRECATION_WARNINGS
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
av_freep(&avctx->extradata);
|
||||||
|
avctx->extradata_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
av_dict_free(&tmp);
|
av_dict_free(&tmp);
|
||||||
av_freep(&avctx->priv_data);
|
av_freep(&avctx->priv_data);
|
||||||
|
|
Loading…
Reference in New Issue