Originally committed as revision 5104 to svn://svn.ffmpeg.org/ffmpeg/trunk
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)
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;