From 10e0298b16908071dd8e34b1c773d5dc96051e73 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Tue, 24 Jan 2012 22:22:13 +0000 Subject: [PATCH] Fix crash in add_ffmpeg_attachment: the value for "filename" metadata may be NULL, so we can't call strlen without checking. Should fix https://forum.handbrake.fr/viewtopic.php?f=11&t=23018 and https://forum.handbrake.fr/viewtopic.php?f=12&t=23101 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4420 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libhb/stream.c b/libhb/stream.c index 69ba920f7..1d7652136 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -5170,7 +5170,7 @@ static void add_ffmpeg_attachment( hb_title_t *title, hb_stream_t *stream, int i break; default: { - int len = strlen( name ); + int len = name ? strlen( name ) : 0; if( len >= 4 && ( !strcmp( name + len - 4, ".ttc" ) || !strcmp( name + len - 4, ".TTC" ) || -- 2.40.0