From d5e01cffea2b0f9cd0fcfae3bf5b98b868589cc0 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 29 Jun 2008 07:25:47 +0000 Subject: Do not use stdata before checking its length git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27142 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mov.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libmpdemux/demux_mov.c') diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c index 974f11d1ad..e7e3551c32 100644 --- a/libmpdemux/demux_mov.c +++ b/libmpdemux/demux_mov.c @@ -928,10 +928,6 @@ static int gen_sh_video(sh_video_t* sh, mov_track_t* trak, int timescale) { 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, mov_track_t* trak, int timescale) { 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 -- cgit v1.2.3