diff options
author | eddyg <eddyg.hb@myreflection.org> | 2008-08-18 04:25:18 +0000 |
---|---|---|
committer | eddyg <eddyg.hb@myreflection.org> | 2008-08-18 04:25:18 +0000 |
commit | 7628e62c73fc0010c29647bb8fcb7471e368aa5e (patch) | |
tree | 52cbe0d0229b85f2541ec97839ca3a0958948ded /libhb | |
parent | 1c4d7309b2924c283f9922adda37d93ad1beca88 (diff) |
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
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; } |