diff options
Diffstat (limited to 'libs/ffvpx/libavutil/avstring.c')
-rw-r--r-- | libs/ffvpx/libavutil/avstring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/ffvpx/libavutil/avstring.c b/libs/ffvpx/libavutil/avstring.c index f03dd2514..4c068f5bc 100644 --- a/libs/ffvpx/libavutil/avstring.c +++ b/libs/ffvpx/libavutil/avstring.c @@ -222,12 +222,13 @@ int av_strcasecmp(const char *a, const char *b) int av_strncasecmp(const char *a, const char *b, size_t n) { - const char *end = a + n; uint8_t c1, c2; + if (n <= 0) + return 0; do { c1 = av_tolower(*a++); c2 = av_tolower(*b++); - } while (a < end && c1 && c1 == c2); + } while (--n && c1 && c1 == c2); return c1 - c2; } |