Mercurial > mplayer.hg
comparison libmpdemux/demux_mov.c @ 35223:425467b5be98
Fix off-by-one error in range check.
author | reimar |
---|---|
date | Wed, 31 Oct 2012 20:44:16 +0000 |
parents | b6636da71bea |
children | 139f2b064ef9 |
comparison
equal
deleted
inserted
replaced
35222:27640f4f0479 | 35223:425467b5be98 |
---|---|
1222 hdr_ptr += 2; | 1222 hdr_ptr += 2; |
1223 // apparently, if count_flag is set, entry is same as i | 1223 // apparently, if count_flag is set, entry is same as i |
1224 if (count_flag & 0x8000) | 1224 if (count_flag & 0x8000) |
1225 entry = i; | 1225 entry = i; |
1226 // only care about top 8 bits of 16-bit R, G, or B value | 1226 // only care about top 8 bits of 16-bit R, G, or B value |
1227 if (entry <= palette_count && entry >= 0) | 1227 if (entry < palette_count && entry >= 0) |
1228 { | 1228 { |
1229 palette_map[entry * 4 + 2] = trak->stdata[hdr_ptr + 0]; | 1229 palette_map[entry * 4 + 2] = trak->stdata[hdr_ptr + 0]; |
1230 palette_map[entry * 4 + 1] = trak->stdata[hdr_ptr + 2]; | 1230 palette_map[entry * 4 + 1] = trak->stdata[hdr_ptr + 2]; |
1231 palette_map[entry * 4 + 0] = trak->stdata[hdr_ptr + 4]; | 1231 palette_map[entry * 4 + 0] = trak->stdata[hdr_ptr + 4]; |
1232 mp_dbg(MSGT_DEMUX, MSGL_DBG2, "QT palette: added entry: %d of %d (colors: R:%x G:%x B:%x)\n", | 1232 mp_dbg(MSGT_DEMUX, MSGL_DBG2, "QT palette: added entry: %d of %d (colors: R:%x G:%x B:%x)\n", |