[MPlayer-cvslog] r38389 - trunk/libmpdemux/demux_avi.c

reimar subversion at mplayerhq.hu
Fri Aug 26 19:29:26 EEST 2022


Author: reimar
Date: Fri Aug 26 19:29:26 2022
New Revision: 38389

Log:
demux_avi.c: check that sh->wf exists before using it.

Modified:
   trunk/libmpdemux/demux_avi.c

Modified: trunk/libmpdemux/demux_avi.c
==============================================================================
--- trunk/libmpdemux/demux_avi.c	Fri Aug 26 19:21:45 2022	(r38388)
+++ trunk/libmpdemux/demux_avi.c	Fri Aug 26 19:29:26 2022	(r38389)
@@ -140,8 +140,9 @@ static int demux_avi_read_packet(demuxer
           if(priv->pts_has_video){
 	      // we have video pts now
 	      float delay=0;
-	      if(((sh_audio_t*)(ds->sh))->wf->nAvgBytesPerSec)
-	          delay=(float)priv->pts_corr_bytes/((sh_audio_t*)(ds->sh))->wf->nAvgBytesPerSec;
+	      sh_audio_t *sh = (sh_audio_t *)ds->sh;
+	      if(sh->wf && sh->wf->nAvgBytesPerSec)
+	          delay=(float)priv->pts_corr_bytes/sh->wf->nAvgBytesPerSec;
 	      mp_msg(MSGT_DEMUX,MSGL_V,"XXX initial  v_pts=%5.3f  a_pos=%d (%5.3f) \n",priv->avi_audio_pts,priv->pts_corr_bytes,delay);
 	      //priv->pts_correction=-priv->avi_audio_pts+delay;
 	      priv->pts_correction=delay-priv->avi_audio_pts;


More information about the MPlayer-cvslog mailing list