Commit 158f0545 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()

Fixes: 55d71971da50365d542ed14b65565fe1/signal_sigsegv_4765a4_8499_f146af090a94f591d6254515c7700ef5.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: 's avatarAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 712d962a
......@@ -525,7 +525,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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment