summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-03-03 20:36:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-03-03 20:36:08 +0000
commitb5c85991f62e84ff412ba187fe3b0490e8ecf5ac (patch)
tree0721b9a5a6286ff548a2337fc7db346d1db565d9 /libavcodec/utils.c
parent50326295a3dcba2e978e23de301d2bdad2448213 (diff)
fix segfault with BLUR8.AVI
Originally committed as revision 5104 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 235c0676d7..801bb482bf 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -844,9 +844,6 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
if(avctx->codec)
goto end;
- avctx->codec = codec;
- avctx->codec_id = codec->id;
- avctx->frame_number = 0;
if (codec->priv_data_size > 0) {
avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data)
@@ -865,9 +862,13 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
goto end;
}
+ avctx->codec = codec;
+ avctx->codec_id = codec->id;
+ avctx->frame_number = 0;
ret = avctx->codec->init(avctx);
if (ret < 0) {
av_freep(&avctx->priv_data);
+ avctx->codec= NULL;
goto end;
}
ret=0;