Commit f9098373 authored by rbultje's avatar rbultje

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.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18126 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7c30c9ef
......@@ -202,6 +202,8 @@ static void sdp_parse_fmtp_config(AVCodecContext *codec, char *attr, char *value
if (!strcmp(attr, "config")) {
/* decode the hexa encoded parameter */
int len = hex_to_data(NULL, value);
if (codec->extradata)
av_free(codec->extradata);
codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
if (!codec->extradata)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment