[FFmpeg-cvslog] r18126 - trunk/libavformat/rtsp.c

rbultje subversion
Sat Mar 21 22:00:00 CET 2009


Author: rbultje
Date: Sat Mar 21 21:59:59 2009
New Revision: 18126

Log:
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.

Modified:
   trunk/libavformat/rtsp.c

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Sat Mar 21 21:58:41 2009	(r18125)
+++ trunk/libavformat/rtsp.c	Sat Mar 21 21:59:59 2009	(r18126)
@@ -202,6 +202,8 @@ static void sdp_parse_fmtp_config(AVCode
             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;



More information about the ffmpeg-cvslog mailing list