avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 17 Jan 2016 14:39:11 +0000 (15:39 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 1 Feb 2016 01:12:21 +0000 (02:12 +0100)
Fixes: 55d71971da50365d542ed14b65565fe1/signal_sigsegv_4765a4_8499_f146af090a94f591d6254515c7700ef5.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 158f0545d81b2aca1c936490f80d13988616910e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ass_split.c

index 413e9c8..04eebe3 100644 (file)
@@ -470,7 +470,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
     if (!style || !*style)
         style = "Default";
     for (i=0; i<ass->styles_count; i++)
-        if (!strcmp(ass->styles[i].name, style))
+        if (ass->styles[i].name && !strcmp(ass->styles[i].name, style))
             return ass->styles + i;
     return NULL;
 }