diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-06-29 07:25:47 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-06-29 07:25:47 +0000 |
commit | d5e01cffea2b0f9cd0fcfae3bf5b98b868589cc0 (patch) | |
tree | 6de8d2f412ca4e17383e81338e27ec0bac1d55df /libmpdemux | |
parent | 08c1e65e276f0a3377d6b9db80d79f7e74ec6137 (diff) | |
download | mpv-d5e01cffea2b0f9cd0fcfae3bf5b98b868589cc0.tar.bz2 mpv-d5e01cffea2b0f9cd0fcfae3bf5b98b868589cc0.tar.xz |
Do not use stdata before checking its length
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27142 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mov.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 |