Skip to content

Commit

Permalink
Image loading fixed:
Browse files Browse the repository at this point in the history
1. The SYSTEM.CNF filename may not contain the ';1'.
2. The int32 overflow fixed.

This commit fixes the bug #1
  • Loading branch information
brainstream committed Sep 14, 2020
1 parent 81b00eb commit d8a3581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(OPT_EXE_NAME "oplpctools")
set(OPT_VERSION_MAJOR 2)
set(OPT_VERSION_MINOR 3)
set(OPT_VERSION_MINOR 4)
set(OPT_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src/OplPcTools)

if(CMAKE_BUILD_TYPE STREQUAL "Release")
Expand Down
5 changes: 3 additions & 2 deletions src/OplPcTools/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ bool Iso9660::readConfig(DeviceSource & _source)
if(record->record_length == 0)
break;
processed += record->record_length;
if(strcmp("SYSTEM.CNF;1", record->filename) == 0)
if(strncmp("SYSTEM.CNF", record->filename, 10) == 0)
result = parseConfig(_source, record);
if(result) break;
}
Expand All @@ -238,7 +238,8 @@ bool Iso9660::readConfig(DeviceSource & _source)

bool Iso9660::parseConfig(DeviceSource & _source, const FileRecord * _file_record)
{
quint32 file_location = _file_record->extent_location * mp_descriptor->block_size;
qint64 ex_location = _file_record->extent_location;
qint64 file_location = ex_location * mp_descriptor->block_size;
if(!_source.seek(file_location))
return false;
QByteArray config(_file_record->data_length, Qt::Uninitialized);
Expand Down

0 comments on commit d8a3581

Please sign in to comment.