Upon iteration ('goto iterate;'), it is known that 'p' is non-zero,
so there is no point in doing the check; it is known that 'p' must
be incremented. Therefore, the 'iterate' label may be moved past
the ternary operator, provided that '++p;' is added just before
the 'goto', so as to perform the required incrementing.
---
 libavformat/protocols.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index b0aae66dab..7e90cb067d 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -95,9 +95,9 @@ const char *avio_enum_protocols(void **const opaque, const 
int output)
 {
     const URLProtocol *const *p;
 
-iterate:
     p = *opaque;
     p = p ? p + 1 : url_protocols;
+iterate:
     *opaque = (void *)p;
     if (!*p) {
         *opaque = NULL;
@@ -105,6 +105,7 @@ iterate:
     }
     if ((output && (*p)->url_write) || (!output && (*p)->url_read))
         return (*p)->name;
+    ++p;
     goto iterate;
 }
 
-- 
2.22.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to