rtpdec_h264: Free old extradata before clearing the pointer
authorMartin Storsjö <martin@martin.st>
Sat, 5 May 2012 13:55:20 +0000 (16:55 +0300)
committerMartin Storsjö <martin@martin.st>
Sat, 5 May 2012 19:11:45 +0000 (22:11 +0300)
This avoids memory leaks if there actually was some extradata
set before.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtpdec_h264.c

index 784c5ec..6efab54 100644 (file)
@@ -114,7 +114,7 @@ static int sdp_parse_fmtp_config_h264(AVStream *stream,
         }
     } else if (!strcmp(attr, "sprop-parameter-sets")) {
         codec->extradata_size = 0;
         }
     } else if (!strcmp(attr, "sprop-parameter-sets")) {
         codec->extradata_size = 0;
-        codec->extradata      = NULL;
+        av_freep(&codec->extradata);
 
         while (*value) {
             char base64packet[1024];
 
         while (*value) {
             char base64packet[1024];