changeset 17833:b3ee00937967

check stream->wf and stream->bih before using them in fix_parameters(). Fixes cid 43
author nicodvb
date Sun, 12 Mar 2006 18:58:08 +0000
parents 7fa8bfd0dea3
children d378f2f39537
files libmpdemux/muxer_lavf.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c	Sun Mar 12 18:31:50 2006 +0000
+++ b/libmpdemux/muxer_lavf.c	Sun Mar 12 18:58:08 2006 +0000
@@ -191,6 +191,8 @@
 
 	if(stream->type == MUXER_TYPE_AUDIO)
 	{
+		if(!stream->wf)
+			return;
 		ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag); 
 #if 0 //breaks aac in mov at least
 		ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
@@ -220,6 +222,8 @@
 	}
 	else if(stream->type == MUXER_TYPE_VIDEO)
 	{
+		if(!stream->bih)
+			return;
 		ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression);
                 if(ctx->codec_id <= 0)
                     ctx->codec_tag= stream->bih->biCompression;