From b97d21e4d6813498f458777ff42c7eab1eed3adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 5 May 2012 16:55:20 +0300 Subject: [PATCH] rtpdec_h264: Free old extradata before clearing the pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids memory leaks if there actually was some extradata set before. Signed-off-by: Martin Storsjö --- libavformat/rtpdec_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 784c5ec1c4..6efab54a29 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -114,7 +114,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream, } } else if (!strcmp(attr, "sprop-parameter-sets")) { codec->extradata_size = 0; - codec->extradata = NULL; + av_freep(&codec->extradata); while (*value) { char base64packet[1024];