From 7628e62c73fc0010c29647bb8fcb7471e368aa5e Mon Sep 17 00:00:00 2001 From: eddyg Date: Mon, 18 Aug 2008 04:25:18 +0000 Subject: Don't crash when the user specifies audio tracks that don't exist from the HandBrakeCLI git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1640 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/common.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libhb/common.c') diff --git a/libhb/common.c b/libhb/common.c index c8cc8dddc..f0ad9e4a2 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -667,8 +667,13 @@ void hb_filter_close( hb_filter_object_t ** _f ) *********************************************************************/ hb_audio_t *hb_audio_copy(const hb_audio_t *src) { - hb_audio_t *audio = calloc(1, sizeof(*audio)); - memcpy(audio, src, sizeof(*audio)); + hb_audio_t *audio = NULL; + + if( src ) + { + audio = calloc(1, sizeof(*audio)); + memcpy(audio, src, sizeof(*audio)); + } return audio; } -- cgit v1.2.3