[XMA] Check for invalid packet number in ValidFrameOffset
This commit is contained in:
parent
8784daf6bc
commit
bfc8ecbeaa
|
@ -225,6 +225,11 @@ bool XmaContext::ValidFrameOffset(uint8_t* block, size_t size_bytes,
|
||||||
size_t frame_offset_bits) {
|
size_t frame_offset_bits) {
|
||||||
uint32_t packet_num =
|
uint32_t packet_num =
|
||||||
GetFramePacketNumber(block, size_bytes, frame_offset_bits);
|
GetFramePacketNumber(block, size_bytes, frame_offset_bits);
|
||||||
|
if (packet_num == -1) {
|
||||||
|
// Invalid packet number
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t* packet = block + (packet_num * kBytesPerPacket);
|
uint8_t* packet = block + (packet_num * kBytesPerPacket);
|
||||||
size_t relative_offset_bits = frame_offset_bits % (kBytesPerPacket * 8);
|
size_t relative_offset_bits = frame_offset_bits % (kBytesPerPacket * 8);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue