[libav-commits] rtpdec_h264: Free old extradata before clearing the pointer

Martin Storsjö git at libav.org
Sat May 5 21:12:54 CEST 2012


Module: libav
Branch: master
Commit: b97d21e4d6813498f458777ff42c7eab1eed3adf

Author:    Martin Storsjö <martin at martin.st>
Committer: Martin Storsjö <martin at martin.st>
Date:      Sat May  5 16:55:20 2012 +0300

rtpdec_h264: Free old extradata before clearing the pointer

This avoids memory leaks if there actually was some extradata
set before.

Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/rtpdec_h264.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 784c5ec..6efab54 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];



More information about the libav-commits mailing list