[FFmpeg-cvslog] avutil/avstring: dont mess with NULL pointers in av_match_list()

Michael Niedermayer git at videolan.org
Sat Jan 18 00:34:02 EET 2025


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jan 15 03:30:21 2025 +0100| [c6c54943d161812b3c4034116cb14f3f5c05dc43] | committer: Michael Niedermayer

avutil/avstring: dont mess with NULL pointers in av_match_list()

Fixes: applying zero offset to null pointer

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavutil/avstring.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 2071dd36a5..875eb691db 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -452,10 +452,12 @@ int av_match_list(const char *name, const char *list, char separator)
                 if (k && (!p[k] || p[k] == separator))
                     return 1;
             q = strchr(q, separator);
-            q += !!q;
+            if(q)
+                q++;
         }
         p = strchr(p, separator);
-        p += !!p;
+        if (p)
+            p++;
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list