# HG changeset patch # User michael # Date 1141418168 0 # Node ID e1157712c1d576f74d26e01914532167bcd1d390 # Parent 5b2a0e54dfa717e3f2ed5e023f17f89e34dde5d7 fix segfault with BLUR8.AVI diff -r 5b2a0e54dfa7 -r e1157712c1d5 utils.c --- a/utils.c Thu Mar 02 21:47:53 2006 +0000 +++ b/utils.c Fri Mar 03 20:36:08 2006 +0000 @@ -844,9 +844,6 @@ 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 @@ 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;