Fix findMedia to make sure it gets both media header segments

This commit is contained in:
Gary Talent 2017-04-08 14:14:59 -05:00
parent fd5beb2adf
commit 9063a0179d

View File

@ -23,8 +23,8 @@ uint8_t *findMedia() {
const static auto headerP2Len = 16;
const static auto headerLen = headerP1Len + headerP2Len + 1;
for (uint8_t *current = &MEM_ROM; current < ((uint8_t*) 0x0a000000); current += headerLen) {
if (ox_memcmp(current, headerP1, headerP1Len) == 0 ||
for (auto current = &MEM_ROM; current < ((uint8_t*) 0x0a000000); current += headerLen) {
if (ox_memcmp(current, headerP1, headerP1Len) == 0 &&
ox_memcmp(current + headerP1Len, headerP2, headerP2Len) == 0) {
return current + headerLen;
}