[FFmpeg-cvslog] avformat/seek: use av_freep() to avoid leaving stale pointers in memory

Michael Niedermayer git at videolan.org
Wed Dec 24 13:20:12 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Dec 24 13:00:03 2014 +0100| [82d1abc44c5e46f8d64a62dc153ea5ece7ac202b] | committer: Michael Niedermayer

avformat/seek: use av_freep() to avoid leaving stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82d1abc44c5e46f8d64a62dc153ea5ece7ac202b
---

 libavformat/seek.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/seek.c b/libavformat/seek.c
index 2368b5e..6a38ba7 100644
--- a/libavformat/seek.c
+++ b/libavformat/seek.c
@@ -470,8 +470,8 @@ void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)
         st->probe_packets = ss->probe_packets;
     }
 
-    av_free(state->stream_states);
-    av_free(state);
+    av_freep(&state->stream_states);
+    av_freep(&state);
 }
 
 static void free_packet_list(AVPacketList *pktl)
@@ -503,6 +503,6 @@ void ff_free_parser_state(AVFormatContext *s, AVParserState *state)
     free_packet_list(state->parse_queue);
     free_packet_list(state->raw_packet_buffer);
 
-    av_free(state->stream_states);
-    av_free(state);
+    av_freep(&state->stream_states);
+    av_freep(&state);
 }



More information about the ffmpeg-cvslog mailing list