mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 03:28:27 +00:00
avcodec/movtextenc: Check for existence of font name before using it
Fixes crashes if the font name is NULL (which it is if a \fn tag is not followed by a font name). Signed-off-by: Charlie Monroe <charlie@charliemonroe.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
41b077762c
commit
34aee50a7f
@ -494,8 +494,10 @@ static void mov_text_alpha_cb(void *priv, int alpha, int alpha_id)
|
||||
|
||||
static uint16_t find_font_id(MovTextContext *s, const char *name)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < s->font_count; i++) {
|
||||
if (!name)
|
||||
return 1;
|
||||
|
||||
for (int i = 0; i < s->font_count; i++) {
|
||||
if (!strcmp(name, s->fonts[i]))
|
||||
return i + 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user