Mercurial > libavformat.hg
comparison rtsp.c @ 4777:31678a2764ee libavformat
Free metadata if already allocated; fixes a memleak if the header occurs twice
in a stream (e.g. malicious input, broken file, etc.). See summary in "[PATCH]
rtsp.c small cleanups" thread on mailinglist.
author | rbultje |
---|---|
date | Sat, 21 Mar 2009 20:59:59 +0000 |
parents | 894e353aaeca |
children | dd4e4ba1535f |
comparison
equal
deleted
inserted
replaced
4776:894e353aaeca | 4777:31678a2764ee |
---|---|
200 case CODEC_ID_MPEG4: | 200 case CODEC_ID_MPEG4: |
201 case CODEC_ID_AAC: | 201 case CODEC_ID_AAC: |
202 if (!strcmp(attr, "config")) { | 202 if (!strcmp(attr, "config")) { |
203 /* decode the hexa encoded parameter */ | 203 /* decode the hexa encoded parameter */ |
204 int len = hex_to_data(NULL, value); | 204 int len = hex_to_data(NULL, value); |
205 if (codec->extradata) | |
206 av_free(codec->extradata); | |
205 codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); | 207 codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); |
206 if (!codec->extradata) | 208 if (!codec->extradata) |
207 return; | 209 return; |
208 codec->extradata_size = len; | 210 codec->extradata_size = len; |
209 hex_to_data(codec->extradata, value); | 211 hex_to_data(codec->extradata, value); |