[MPlayer-cvslog] r27142 - trunk/libmpdemux/demux_mov.c

reimar subversion at mplayerhq.hu
Sun Jun 29 09:25:48 CEST 2008


Author: reimar
Date: Sun Jun 29 09:25:47 2008
New Revision: 27142

Log:
Do not use stdata before checking its length


Modified:
   trunk/libmpdemux/demux_mov.c

Modified: trunk/libmpdemux/demux_mov.c
==============================================================================
--- trunk/libmpdemux/demux_mov.c	(original)
+++ trunk/libmpdemux/demux_mov.c	Sun Jun 29 09:25:47 2008
@@ -928,10 +928,6 @@ static int gen_sh_video(sh_video_t* sh, 
 		int hdr_ptr = 76;  // the byte just after depth
 		unsigned char *palette_map;
 
-		depth = trak->stdata[75] | (trak->stdata[74] << 8);
-		if (trak->fourcc == mmioFOURCC('r', 'a', 'w', ' ')) {
-		    sh->format = IMGFMT_RGB | depth;
-		} else
 		    sh->format=trak->fourcc;
 
 		// crude video delay from editlist0 hack ::atm
@@ -949,6 +945,11 @@ static int gen_sh_video(sh_video_t* sh, 
 		  trak->stdata_len);
 		  return 0;
 		}
+
+		depth = trak->stdata[75] | (trak->stdata[74] << 8);
+		if (trak->fourcc == mmioFOURCC('r', 'a', 'w', ' '))
+		    sh->format = IMGFMT_RGB | depth;
+
 //  stdata[]:
 //	8   short	version
 //	10  short	revision



More information about the MPlayer-cvslog mailing list