summaryrefslogtreecommitdiffstats
path: root/libhb/muxmp4.c
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2008-06-26 01:19:47 +0000
committersaintdev <[email protected]>2008-06-26 01:19:47 +0000
commit345c583574d3db3a664347304b8eb0495369ea69 (patch)
tree7c8eace88698763a882059bce69e0256616acf84 /libhb/muxmp4.c
parent5ac8f06abf85cd5f105ca543d0c2cefdab2fc627 (diff)
Fix a crash when using mp4 and no audio tracks.
Because there were no audio structs on list_audio, audio->config was attempting to dereference a NULL pointer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1540 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r--libhb/muxmp4.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index 638bc7e9f..db0c9b716 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -148,10 +148,16 @@ static int MP4Init( hb_mux_object_t * m )
/* Flags for enabling/disabling tracks in an MP4. */
typedef enum { TRACK_DISABLED = 0x0, TRACK_ENABLED = 0x1, TRACK_IN_MOVIE = 0x2, TRACK_IN_PREVIEW = 0x4, TRACK_IN_POSTER = 0x8} track_header_flags;
- /* Need the sample rate of the first audio track to use as the timescale. */
- audio = hb_list_item(title->list_audio, 0);
- m->samplerate = audio->config.out.samplerate;
- audio = NULL;
+ if( (audio = hb_list_item(title->list_audio, 0)) != NULL )
+ {
+ /* Need the sample rate of the first audio track to use as the timescale. */
+ m->samplerate = audio->config.out.samplerate;
+ audio = NULL;
+ }
+ else
+ {
+ m->samplerate = 90000;
+ }
/* Create an empty mp4 file */
if (job->largeFileSize)