Commit 098b5b33 authored by benoit's avatar benoit

Fix segfault when encoder initialization fails.

Patch by Craig Thomasson $(name) dot $(surname) ripcode com


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22811 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent bc4fa664
......@@ -710,7 +710,7 @@ av_cold int avcodec_close(AVCodecContext *avctx)
avctx->codec->close(avctx);
avcodec_default_free_buffers(avctx);
av_freep(&avctx->priv_data);
if(avctx->codec->encode)
if(avctx->codec && avctx->codec->encode)
av_freep(&avctx->extradata);
avctx->codec = NULL;
entangled_thread_counter--;
......
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