comparison mpegaudiodec_float.c @ 12187:fb3fcaf3c1b6 libavcodec

Fix memleak when using mp*float decoder. Patch by flybird2k at gmail
author cehoyos
date Sun, 18 Jul 2010 19:53:24 +0000
parents 49c528a39187
children
comparison
equal deleted inserted replaced
12186:fb2f04f70afe 12187:fb3fcaf3c1b6
78 78
79 ptr += 18; 79 ptr += 18;
80 } 80 }
81 } 81 }
82 82
83 static av_cold int decode_end(AVCodecContext * avctx)
84 {
85 MPADecodeContext *s = avctx->priv_data;
86 ff_dct_end(&s->dct);
87 return 0;
88 }
89
83 #if CONFIG_MP1FLOAT_DECODER 90 #if CONFIG_MP1FLOAT_DECODER
84 AVCodec mp1float_decoder = 91 AVCodec mp1float_decoder =
85 { 92 {
86 "mp1float", 93 "mp1float",
87 AVMEDIA_TYPE_AUDIO, 94 AVMEDIA_TYPE_AUDIO,
88 CODEC_ID_MP1, 95 CODEC_ID_MP1,
89 sizeof(MPADecodeContext), 96 sizeof(MPADecodeContext),
90 decode_init, 97 decode_init,
91 NULL, 98 NULL,
92 NULL, 99 decode_end,
93 decode_frame, 100 decode_frame,
94 CODEC_CAP_PARSE_ONLY, 101 CODEC_CAP_PARSE_ONLY,
95 .flush= flush, 102 .flush= flush,
96 .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), 103 .long_name= NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
97 }; 104 };
103 AVMEDIA_TYPE_AUDIO, 110 AVMEDIA_TYPE_AUDIO,
104 CODEC_ID_MP2, 111 CODEC_ID_MP2,
105 sizeof(MPADecodeContext), 112 sizeof(MPADecodeContext),
106 decode_init, 113 decode_init,
107 NULL, 114 NULL,
108 NULL, 115 decode_end,
109 decode_frame, 116 decode_frame,
110 CODEC_CAP_PARSE_ONLY, 117 CODEC_CAP_PARSE_ONLY,
111 .flush= flush, 118 .flush= flush,
112 .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), 119 .long_name= NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
113 }; 120 };
119 AVMEDIA_TYPE_AUDIO, 126 AVMEDIA_TYPE_AUDIO,
120 CODEC_ID_MP3, 127 CODEC_ID_MP3,
121 sizeof(MPADecodeContext), 128 sizeof(MPADecodeContext),
122 decode_init, 129 decode_init,
123 NULL, 130 NULL,
124 NULL, 131 decode_end,
125 decode_frame, 132 decode_frame,
126 CODEC_CAP_PARSE_ONLY, 133 CODEC_CAP_PARSE_ONLY,
127 .flush= flush, 134 .flush= flush,
128 .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), 135 .long_name= NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
129 }; 136 };
135 AVMEDIA_TYPE_AUDIO, 142 AVMEDIA_TYPE_AUDIO,
136 CODEC_ID_MP3ADU, 143 CODEC_ID_MP3ADU,
137 sizeof(MPADecodeContext), 144 sizeof(MPADecodeContext),
138 decode_init, 145 decode_init,
139 NULL, 146 NULL,
140 NULL, 147 decode_end,
141 decode_frame_adu, 148 decode_frame_adu,
142 CODEC_CAP_PARSE_ONLY, 149 CODEC_CAP_PARSE_ONLY,
143 .flush= flush, 150 .flush= flush,
144 .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), 151 .long_name= NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
145 }; 152 };