comparison libmpdemux/muxer_lavf.c @ 17828:d6fe562d4e49

check muxer != NULL before using it; closes cid 201
author nicodvb
date Sun, 12 Mar 2006 17:46:51 +0000
parents fa17424b4c7b
children ff148faa7ed5
comparison
equal deleted inserted replaced
17827:edef5f47dfac 17828:d6fe562d4e49
101 NULL 101 NULL
102 }; 102 };
103 103
104 static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type) 104 static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type)
105 { 105 {
106 if(!muxer) return NULL;
106 muxer_priv_t *priv = (muxer_priv_t*) muxer->priv; 107 muxer_priv_t *priv = (muxer_priv_t*) muxer->priv;
107 muxer_stream_t *stream; 108 muxer_stream_t *stream;
108 muxer_stream_priv_t *spriv; 109 muxer_stream_priv_t *spriv;
109 AVCodecContext *ctx; 110 AVCodecContext *ctx;
110 111
111 if(!muxer || (type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO)) 112 if(type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO)
112 { 113 {
113 mp_msg(MSGT_MUXER, MSGL_ERR, "UNKNOW TYPE %d\n", type); 114 mp_msg(MSGT_MUXER, MSGL_ERR, "UNKNOW TYPE %d\n", type);
114 return NULL; 115 return NULL;
115 } 116 }
116 117