1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Make av_parse_color() return AVERROR(EINVAL) rather than -1.

Originally committed as revision 23120 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Stefano Sabatini 2010-05-13 18:26:03 +00:00
parent 40914d97cc
commit dc0eaef318

View File

@ -231,7 +231,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
if (*tail || (len != 8 && len != 10)) { if (*tail || (len != 8 && len != 10)) {
av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string); av_log(log_ctx, AV_LOG_ERROR, "Invalid 0xRRGGBB[AA] color string: '%s'\n", color_string);
return -1; return AVERROR(EINVAL);
} }
if (len == 10) { if (len == 10) {
rgba_color[3] = rgba; rgba_color[3] = rgba;
@ -248,7 +248,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
color_table_compare); color_table_compare);
if (!entry) { if (!entry) {
av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string); av_log(log_ctx, AV_LOG_ERROR, "Cannot find color '%s'\n", color_string);
return -1; return AVERROR(EINVAL);
} }
memcpy(rgba_color, entry->rgba_color, 4); memcpy(rgba_color, entry->rgba_color, 4);
} }