changeset 17828:d6fe562d4e49

check muxer != NULL before using it; closes cid 201
author nicodvb
date Sun, 12 Mar 2006 17:46:51 +0000
parents edef5f47dfac
children ff148faa7ed5
files libmpdemux/muxer_lavf.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c	Sun Mar 12 17:40:32 2006 +0000
+++ b/libmpdemux/muxer_lavf.c	Sun Mar 12 17:46:51 2006 +0000
@@ -103,12 +103,13 @@
 
 static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type)
 {
+	if(!muxer) return NULL;
 	muxer_priv_t *priv = (muxer_priv_t*) muxer->priv;
 	muxer_stream_t *stream;
 	muxer_stream_priv_t *spriv;
 	AVCodecContext *ctx;
 
-	if(!muxer || (type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO)) 
+	if(type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO) 
 	{
 		mp_msg(MSGT_MUXER, MSGL_ERR, "UNKNOW TYPE %d\n", type);
 		return NULL;