From 7d09a993d14c420ce53070312e77a224dbb4bc99 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 21 Mar 2009 20:59:59 +0000 Subject: 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. Originally committed as revision 18126 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtsp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 47378146fe..5100c978e6 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -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; -- cgit v1.2.3