diff options
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r-- | libavutil/parseutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 6e50d70657..da7180fcfb 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -389,7 +389,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, } if (tail) { - unsigned long int alpha; + double alpha; const char *alpha_string = tail; if (!strncmp(alpha_string, "0x", 2)) { alpha = strtoul(alpha_string, &tail, 16); @@ -401,7 +401,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, alpha = 255 * norm_alpha; } - if (tail == alpha_string || *tail || alpha > 255) { + if (tail == alpha_string || *tail || alpha > 255 || alpha < 0) { av_log(log_ctx, AV_LOG_ERROR, "Invalid alpha value specifier '%s' in '%s'\n", alpha_string, color_string); return AVERROR(EINVAL); |