Commit 9f0b7f62 authored by michael's avatar michael

fix segfault with BLUR8.AVI


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5104 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 051382ef
......@@ -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;
......
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