Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-07-29 22:22:17 +0300
committerClément Bœsch <u@pkh.me>2017-08-01 16:50:00 +0300
commit479ab8c3f842145fcdd87a574b3fd7b4022034a3 (patch)
treee874d027fad3bbb7784e539be38a144983bb4341 /libavcodec/htmlsubtitles.c
parente80037186327f97fffad75161e7d71cd9f5685f6 (diff)
lavc/htmlsubtitles: handle colors starting with many '#'
Diffstat (limited to 'libavcodec/htmlsubtitles.c')
-rw-r--r--libavcodec/htmlsubtitles.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/htmlsubtitles.c b/libavcodec/htmlsubtitles.c
index ae2c48b501..3205d57149 100644
--- a/libavcodec/htmlsubtitles.c
+++ b/libavcodec/htmlsubtitles.c
@@ -28,6 +28,10 @@
static int html_color_parse(void *log_ctx, const char *str)
{
uint8_t rgba[4];
+ int nb_sharps = 0;
+ while (str[nb_sharps] == '#')
+ nb_sharps++;
+ str += FFMAX(0, nb_sharps - 1);
if (av_parse_color(rgba, str, strcspn(str, "\" >"), log_ctx) < 0)
return -1;
return rgba[0] | rgba[1] << 8 | rgba[2] << 16;