mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 20:10:09 +01:00
avcodec/avcodec: Actually honour the documentation of subtitle_header
It is only supposed to be freed by libavcodec for decoders, yet avcodec_open2() always frees it on failure. Furthermore, avcodec_close() doesn't free it for decoders. Both of this has been changed. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -418,6 +418,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
|
|
||||||
av_dict_free(&tmp);
|
av_dict_free(&tmp);
|
||||||
av_freep(&avctx->priv_data);
|
av_freep(&avctx->priv_data);
|
||||||
|
if (av_codec_is_decoder(avctx->codec))
|
||||||
av_freep(&avctx->subtitle_header);
|
av_freep(&avctx->subtitle_header);
|
||||||
|
|
||||||
#if FF_API_OLD_ENCDEC
|
#if FF_API_OLD_ENCDEC
|
||||||
@@ -589,7 +590,9 @@ 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
|
||||||
}
|
} else if (av_codec_is_decoder(avctx->codec))
|
||||||
|
av_freep(&avctx->subtitle_header);
|
||||||
|
|
||||||
avctx->codec = NULL;
|
avctx->codec = NULL;
|
||||||
avctx->active_thread_type = 0;
|
avctx->active_thread_type = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user