# HG changeset patch # User rbultje # Date 1237669199 0 # Node ID 31678a2764eead1080fc4a2261ea737856aa9bf0 # Parent 894e353aaecaf6b69b7275dd64e3d9c0d4a67604 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. diff -r 894e353aaeca -r 31678a2764ee rtsp.c --- a/rtsp.c Sat Mar 21 20:58:41 2009 +0000 +++ b/rtsp.c Sat Mar 21 20:59:59 2009 +0000 @@ -202,6 +202,8 @@ 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;