comparison ffv1.c @ 1994:8d3540dddd1b libavcodec

cleanup & memleak fix
author michael
date Fri, 30 Apr 2004 17:42:58 +0000
parents e20fd60b215c
children 18d5eb75ae71
comparison
equal deleted inserted replaced
1993:5086ee0ea559 1994:8d3540dddd1b
1016 } 1016 }
1017 1017
1018 return bytes_read; 1018 return bytes_read;
1019 } 1019 }
1020 1020
1021 static int decode_end(AVCodecContext *avctx)
1022 {
1023 FFV1Context *s = avctx->priv_data;
1024 int i;
1025
1026 if(avctx->get_buffer == avcodec_default_get_buffer){
1027 for(i=0; i<4; i++){
1028 av_freep(&s->picture.base[i]);
1029 s->picture.data[i]= NULL;
1030 }
1031 av_freep(&s->picture.opaque);
1032 }
1033
1034 return 0;
1035 }
1036
1037 AVCodec ffv1_decoder = { 1021 AVCodec ffv1_decoder = {
1038 "ffv1", 1022 "ffv1",
1039 CODEC_TYPE_VIDEO, 1023 CODEC_TYPE_VIDEO,
1040 CODEC_ID_FFV1, 1024 CODEC_ID_FFV1,
1041 sizeof(FFV1Context), 1025 sizeof(FFV1Context),
1042 decode_init, 1026 decode_init,
1043 NULL, 1027 NULL,
1044 decode_end, 1028 NULL,
1045 decode_frame, 1029 decode_frame,
1046 CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/, 1030 CODEC_CAP_DR1 /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
1047 NULL 1031 NULL
1048 }; 1032 };
1049 1033