diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-08 22:00:07 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-12-08 22:00:07 +0000 |
commit | 7d132c544b2447ef5a6b04ca6f21e245d6a48986 (patch) | |
tree | e4d90f9dcd05ce387c68d5c508ee9126d5457de4 | |
parent | 758c7455f165af6e47467c136dd439e275ac1298 (diff) | |
download | ffmpeg-7d132c544b2447ef5a6b04ca6f21e245d6a48986.tar.gz |
Use an unsigned int to contain all the color values of the expressions
of the type 0xRRGBBAA parsed by av_parse_color(), using a simple int
was resulting in unexpected results as the most significant bit was
used for the sign.
Originally committed as revision 20778 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavfilter/parseutils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/parseutils.c b/libavfilter/parseutils.c index 7cafa52cb0..0b67d3ddac 100644 --- a/libavfilter/parseutils.c +++ b/libavfilter/parseutils.c @@ -227,7 +227,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) if (!strncmp(color_string, "0x", 2)) { char *tail; int len = strlen(color_string); - int rgba = strtol(color_string, &tail, 16); + unsigned int rgba = strtoul(color_string, &tail, 16); if (*tail || (len != 8 && len != 10)) { av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string); @@ -412,6 +412,7 @@ int main(void) "Red", "0x000000", "0x0000000", + "0xff000000", "0x3e34ff", "0x3e34ffaa", "0xffXXee", |