comparison utils.c @ 3159:e1157712c1d5 libavcodec

fix segfault with BLUR8.AVI
author michael
date Fri, 03 Mar 2006 20:36:08 +0000
parents ddf6d81a6369
children 53f0b29ff865
comparison
equal deleted inserted replaced
3158:5b2a0e54dfa7 3159:e1157712c1d5
842 } 842 }
843 843
844 if(avctx->codec) 844 if(avctx->codec)
845 goto end; 845 goto end;
846 846
847 avctx->codec = codec;
848 avctx->codec_id = codec->id;
849 avctx->frame_number = 0;
850 if (codec->priv_data_size > 0) { 847 if (codec->priv_data_size > 0) {
851 avctx->priv_data = av_mallocz(codec->priv_data_size); 848 avctx->priv_data = av_mallocz(codec->priv_data_size);
852 if (!avctx->priv_data) 849 if (!avctx->priv_data)
853 goto end; 850 goto end;
854 } else { 851 } else {
863 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){ 860 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){
864 av_freep(&avctx->priv_data); 861 av_freep(&avctx->priv_data);
865 goto end; 862 goto end;
866 } 863 }
867 864
865 avctx->codec = codec;
866 avctx->codec_id = codec->id;
867 avctx->frame_number = 0;
868 ret = avctx->codec->init(avctx); 868 ret = avctx->codec->init(avctx);
869 if (ret < 0) { 869 if (ret < 0) {
870 av_freep(&avctx->priv_data); 870 av_freep(&avctx->priv_data);
871 avctx->codec= NULL;
871 goto end; 872 goto end;
872 } 873 }
873 ret=0; 874 ret=0;
874 end: 875 end:
875 entangled_thread_counter--; 876 entangled_thread_counter--;