Skip to content

Commit d8a3581

Browse files
committed
Image loading fixed:
1. The SYSTEM.CNF filename may not contain the ';1'. 2. The int32 overflow fixed. This commit fixes the bug #1
1 parent 81b00eb commit d8a3581

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ set(CMAKE_CXX_STANDARD 14)
3030
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3131
set(OPT_EXE_NAME "oplpctools")
3232
set(OPT_VERSION_MAJOR 2)
33-
set(OPT_VERSION_MINOR 3)
33+
set(OPT_VERSION_MINOR 4)
3434
set(OPT_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src/OplPcTools)
3535

3636
if(CMAKE_BUILD_TYPE STREQUAL "Release")

src/OplPcTools/Device.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ bool Iso9660::readConfig(DeviceSource & _source)
229229
if(record->record_length == 0)
230230
break;
231231
processed += record->record_length;
232-
if(strcmp("SYSTEM.CNF;1", record->filename) == 0)
232+
if(strncmp("SYSTEM.CNF", record->filename, 10) == 0)
233233
result = parseConfig(_source, record);
234234
if(result) break;
235235
}
@@ -238,7 +238,8 @@ bool Iso9660::readConfig(DeviceSource & _source)
238238

239239
bool Iso9660::parseConfig(DeviceSource & _source, const FileRecord * _file_record)
240240
{
241-
quint32 file_location = _file_record->extent_location * mp_descriptor->block_size;
241+
qint64 ex_location = _file_record->extent_location;
242+
qint64 file_location = ex_location * mp_descriptor->block_size;
242243
if(!_source.seek(file_location))
243244
return false;
244245
QByteArray config(_file_record->data_length, Qt::Uninitialized);

0 commit comments

Comments
 (0)