summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-10-09 21:11:07 +0000
committerjstebbins <[email protected]>2010-10-09 21:11:07 +0000
commit9f0780137b17fb5c04a40dd911fa46d58a280fb7 (patch)
tree9bf0eaee16cb02d368863ba3f3e1869172af797c /libhb
parent3a29e0dcbb866ba57b19cf76fc80f3e3d804992a (diff)
prevent crash when vorbis fails to initialize for any reason.
headers used in muxmkv were not initialized and the garbage made mk_laceXiph crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3591 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/encvorbis.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/encvorbis.c b/libhb/encvorbis.c
index ce27ea021..f483a097f 100644
--- a/libhb/encvorbis.c
+++ b/libhb/encvorbis.c
@@ -68,6 +68,12 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job )
}
/* init */
+ for( i = 0; i < 3; i++ )
+ {
+ // Zero vorbis headers so that we don't crash in mk_laceXiph
+ // when vorbis_encode_setup_managed fails.
+ memset( w->config->vorbis.headers[i], 0, sizeof( ogg_packet ) );
+ }
vorbis_info_init( &pv->vi );
if( vorbis_encode_setup_managed( &pv->vi, pv->out_discrete_channels,
audio->config.out.samplerate, -1, 1000 * audio->config.out.bitrate, -1 ) )