Bug 790830 - "Assertion failed: (len == 9 || len == 8), function parseHexColor" in test plugin. r=joshmoz.

This commit is contained in:
Rafael Ávila de Espíndola 2012-10-10 13:54:43 -04:00
parent 5bd91d02a4
commit 2b545412b3

View File

@ -93,7 +93,9 @@ parseHexColor(const char* color, int len)
uint8_t bgra[4] = { 0, 0, 0, 0xFF };
int i = 0;
assert(len == 9 || len == 8);
// Ignore unsupported formats.
if (len != 9 && len != 8)
return 0;
// start from the right and work to the left
while (len >= 2) { // we have at least #AA or AA left.