Browse Source

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
tags/v0.6
Craig Thomasson Benoit Fouet 15 years ago
parent
commit
77a670e796
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/utils.c

+ 1
- 1
libavcodec/utils.c View File

@@ -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--;


Loading…
Cancel
Save