+fn read_palette(br: &mut ByteReader, size: u64, pal: &mut Vec<u16>) -> DemuxerResult<u64> {
+ let _seed = br.read_u32be()?;
+ let _flags = br.read_u16be()?;
+ let palsize = (br.read_u16be()? as usize) + 1;
+ validate!(palsize <= 256);
+ validate!((palsize as u64) * 8 + 8 == size);
+ pal.resize(palsize * 4, 0);
+ for i in 0..palsize {
+ let a = br.read_u16be()?;
+ let r = br.read_u16be()?;
+ let g = br.read_u16be()?;
+ let b = br.read_u16be()?;
+ pal[i * 4] = a;
+ pal[i * 4 + 1] = r;
+ pal[i * 4 + 2] = g;
+ pal[i * 4 + 3] = b;
+ }
+ Ok(size)
+}
+