mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-01 05:31:04 +08:00
Add a NULL pointer check to avcodec_close() this should prevent a segfault
when closing without open. Originally committed as revision 20495 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -675,7 +675,7 @@ int avcodec_close(AVCodecContext *avctx)
|
|||||||
|
|
||||||
if (HAVE_THREADS && avctx->thread_opaque)
|
if (HAVE_THREADS && avctx->thread_opaque)
|
||||||
avcodec_thread_free(avctx);
|
avcodec_thread_free(avctx);
|
||||||
if (avctx->codec->close)
|
if (avctx->codec && avctx->codec->close)
|
||||||
avctx->codec->close(avctx);
|
avctx->codec->close(avctx);
|
||||||
avcodec_default_free_buffers(avctx);
|
avcodec_default_free_buffers(avctx);
|
||||||
av_freep(&avctx->priv_data);
|
av_freep(&avctx->priv_data);
|
||||||
|
Reference in New Issue
Block a user