[FFmpeg-devel] [PATCH] avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
Andreas Cadhalpun
andreas.cadhalpun at googlemail.com
Wed Jan 20 01:08:37 CET 2016
On 17.01.2016 15:55, Michael Niedermayer wrote:
> From: Michael Niedermayer <michael at niedermayer.cc>
>
> Fixes: 55d71971da50365d542ed14b65565fe1/signal_sigsegv_4765a4_8499_f146af090a94f591d6254515c7700ef5.mkv
>
> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> libavcodec/ass_split.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
> index 9bc7b9d..f84a686 100644
> --- a/libavcodec/ass_split.c
> +++ b/libavcodec/ass_split.c
> @@ -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;
> }
>
Looks good to me.
Best regards,
Andreas
More information about the ffmpeg-devel
mailing list