avformat/seek: move the cur variable into the loop
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Dec 2014 12:01:31 +0000 (13:01 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Dec 2014 12:14:07 +0000 (13:14 +0100)
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 <michaelni@gmx.at>
libavformat/seek.c

index 6a38ba79e5b048b54c536a0a6914dd0d3d35605c..967f282d5191837412d48e22949624333fb119d5 100644 (file)
@@ -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);