Hi,

I hope I'm submitting this fix correctly - some subtitles will cause FFmpeg to 
crash when searching for a font in movtextencode. One such subtitles file is 
appended. The crash occurrs in find_font_id where the name argument passed is 
NULL.

Here is an example command for reproducing the issue:

ffmpeg -i test.mp4 -i test.ass -c:v copy -c:a copy -c:s 'mov_text' out.mp4

Cheers,

Charlie



Signed-off-by: Charlie Monroe <char...@charliemonroe.net>
---
libavcodec/movtextenc.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 5869942ec0..df3a2dd97a 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -494,6 +494,9 @@ static void mov_text_alpha_cb(void *priv, int alpha, int 
alpha_id)

static uint16_t find_font_id(MovTextContext *s, const char *name)
{
+    if (name == NULL)
+        return 1;
+    
   int i;
   for (i = 0; i < s->font_count; i++) {
       if (!strcmp(name, s->fonts[i]))
-- 
2.30.1 (Apple Git-130)


Attachment: test.ass
Description: Binary data

Attachment: patch.diff
Description: Binary data

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to