avformat/seek: use av_freep() to avoid leaving stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Dec 2014 12:00:03 +0000 (13:00 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Dec 2014 12:14:07 +0000 (13:14 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/seek.c

index 2368b5e5b91e56fc4f3d297953c0b9384d57aaa9..6a38ba79e5b048b54c536a0a6914dd0d3d35605c 100644 (file)
@@ -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);
 }