avformat/rtpdec_latm: Use av_freep() to avoid leaving stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Dec 2014 14:34:29 +0000 (15:34 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 23 Dec 2014 14:34:29 +0000 (15:34 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtpdec_latm.c

index 3896482..c3cb2f2 100644 (file)
@@ -45,7 +45,7 @@ static void latm_free_context(PayloadContext *data)
         avio_close_dyn_buf(data->dyn_buf, &p);
         av_free(p);
     }
-    av_free(data->buf);
+    av_freep(&data->buf);
     av_free(data);
 }
 
@@ -72,7 +72,7 @@ static int latm_parse_packet(AVFormatContext *ctx, PayloadContext *data,
 
         if (!(flags & RTP_FLAG_MARKER))
             return AVERROR(EAGAIN);
-        av_free(data->buf);
+        av_freep(&data->buf);
         data->len = avio_close_dyn_buf(data->dyn_buf, &data->buf);
         data->dyn_buf = NULL;
         data->pos = 0;