1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

fix segfault with BLUR8.AVI

Originally committed as revision 5104 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-03-03 20:36:08 +00:00
parent 50326295a3
commit b5c85991f6

View File

@ -844,9 +844,6 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
if(avctx->codec) if(avctx->codec)
goto end; goto end;
avctx->codec = codec;
avctx->codec_id = codec->id;
avctx->frame_number = 0;
if (codec->priv_data_size > 0) { if (codec->priv_data_size > 0) {
avctx->priv_data = av_mallocz(codec->priv_data_size); avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data) if (!avctx->priv_data)
@ -865,9 +862,13 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
goto end; goto end;
} }
avctx->codec = codec;
avctx->codec_id = codec->id;
avctx->frame_number = 0;
ret = avctx->codec->init(avctx); ret = avctx->codec->init(avctx);
if (ret < 0) { if (ret < 0) {
av_freep(&avctx->priv_data); av_freep(&avctx->priv_data);
avctx->codec= NULL;
goto end; goto end;
} }
ret=0; ret=0;