diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2013-12-26 04:50:19 +0200 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2014-01-07 23:00:01 +0200 |
commit | a7ccf5993b468e3a85a1f7e127b6e384bcd463e6 (patch) | |
tree | 8addd052622c369d11a9a0e77b588bfe5670b462 | |
parent | 190fb1eac04f6c0de92ceaa3c4a7e54e10ddb754 (diff) | |
download | libass-a7ccf5993b468e3a85a1f7e127b6e384bcd463e6.tar.bz2 libass-a7ccf5993b468e3a85a1f7e127b6e384bcd463e6.tar.xz |
Accept colors with arbitrary sequences of leading & and H
-rw-r--r-- | libass/ass_utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libass/ass_utils.c b/libass/ass_utils.c index 3dab74c..3c2c40a 100644 --- a/libass/ass_utils.c +++ b/libass/ass_utils.c @@ -81,7 +81,8 @@ int strtocolor(ASS_Library *library, char **q, uint32_t *res, int hex) int base = hex ? 16 : 10; if (*p == '&') - ++p; + while (*p == '&') + ++p; else ass_msg(library, MSGL_DBG2, "suspicious color format: \"%s\"\n", p); @@ -92,6 +93,9 @@ int strtocolor(ASS_Library *library, char **q, uint32_t *res, int hex) result = mystrtou32(&p, base, &color); } + while (*p == '&' || *p == 'H') + ++p; + { unsigned char *tmp = (unsigned char *) (&color); unsigned char b; |