From 96dce6f7ceaa8d3c7eddd241213bec82e84e7f7a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 24 Dec 2014 13:01:31 +0100 Subject: [PATCH] avformat/seek: move the cur variable into the loop This improves readability and makes it clear that the freed value is not used after the end of an iteration Signed-off-by: Michael Niedermayer --- libavformat/seek.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/seek.c b/libavformat/seek.c index 6a38ba79e5..967f282d51 100644 --- a/libavformat/seek.c +++ b/libavformat/seek.c @@ -476,9 +476,8 @@ void ff_restore_parser_state(AVFormatContext *s, AVParserState *state) static void free_packet_list(AVPacketList *pktl) { - AVPacketList *cur; while (pktl) { - cur = pktl; + AVPacketList *cur = pktl; pktl = cur->next; av_free_packet(&cur->pkt); av_free(cur);