changeset 17818:e2f06b46dac0

dereference muxer->priv only after having checked muxer!=NULL in write_chunk(); closes cid 206
author nicodvb
date Sat, 11 Mar 2006 23:38:54 +0000
parents 560617cdcc3b
children 7d5716fd634c
files libmpdemux/muxer_mpeg.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_mpeg.c	Sat Mar 11 23:29:02 2006 +0000
+++ b/libmpdemux/muxer_mpeg.c	Sat Mar 11 23:38:54 2006 +0000
@@ -327,11 +327,12 @@
 static int add_frame(muxer_headers_t *spriv, uint64_t idur, uint8_t *ptr, int len, uint8_t pt, uint32_t temp_ref);
 
 static muxer_stream_t* mpegfile_new_stream(muxer_t *muxer,int type){
-  muxer_priv_t *priv = (muxer_priv_t*) muxer->priv;
+  muxer_priv_t *priv;
   muxer_stream_t *s;
   muxer_headers_t *spriv;
 
   if (!muxer) return NULL;
+  priv = (muxer_priv_t*) muxer->priv;
   if(muxer->avih.dwStreams>=MUXER_MAX_STREAMS){
     mp_msg(MSGT_MUXER, MSGL_ERR, "Too many streams! increase MUXER_MAX_STREAMS !\n");
     return NULL;