1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00

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: 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>
This commit is contained in:
Michael Niedermayer 2016-01-17 15:39:11 +01:00
parent b9551e71bf
commit c6f6829ce6

View File

@ -525,7 +525,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
if (!style || !*style) if (!style || !*style)
style = "Default"; style = "Default";
for (i=0; i<ass->styles_count; i++) 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 ass->styles + i;
return NULL; return NULL;
} }