# HG changeset patch # User reimar # Date 1214724347 0 # Node ID f83be44e1faf877f3e3c29884fab3437d5d15a2c # Parent 9440e551f9e347d7158a39bd8aedbf176fbeeee0 Do not use stdata before checking its length diff -r 9440e551f9e3 -r f83be44e1faf libmpdemux/demux_mov.c --- a/libmpdemux/demux_mov.c Sat Jun 28 19:32:35 2008 +0000 +++ b/libmpdemux/demux_mov.c Sun Jun 29 07:25:47 2008 +0000 @@ -928,10 +928,6 @@ 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 @@ 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