summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCraig Thomasson <craig.thomasson@ripcode.com>2010-04-06 09:52:41 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2010-04-06 09:52:41 +0000
commit77a670e7967ec16d9acf43248bb2d035acadb8c5 (patch)
tree70ebb749d5f154665a256f91d2bf2a66ab317a62 /libavcodec
parent2100348c3ee4ad9bdf9284b0ed367892e4c8c70b (diff)
Fix segfault when encoder initialization fails.
Patch by Craig Thomasson $(name) dot $(surname) ripcode com Originally committed as revision 22811 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 52aa672541..8b4b363af4 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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--;