Skip to content

Commit 98cfa7c

Browse files
committed
gta5view 1.9.2
1 parent b8ad311 commit 98cfa7c

File tree

8 files changed

+85
-34
lines changed

8 files changed

+85
-34
lines changed

.ci/app.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BEGIN
2424
VALUE "FileDescription", "gta5view"
2525
VALUE "FileVersion", "MAJOR_VER.MINOR_VER.PATCH_VERSTR_BUILD_VER"
2626
VALUE "InternalName", "gta5view"
27-
VALUE "LegalCopyright", "Copyright � 2016-2020 Syping"
27+
VALUE "LegalCopyright", "Copyright � 2016-2021 Syping"
2828
VALUE "OriginalFilename", "gta5view.exe"
2929
VALUE "ProductName", "gta5view"
3030
VALUE "ProductVersion", "MAJOR_VER.MINOR_VER.PATCH_VERSTR_BUILD_VER"

.ci/gta5view.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
!define APP_NAME "gta5view"
44
!define COMP_NAME "Syping"
55
!define WEB_SITE "https://gta5view.syping.de/"
6-
!define VERSION "1.9.1.0"
7-
!define COPYRIGHT "Copyright © 2016-2020 Syping"
6+
!define VERSION "1.9.2.0"
7+
!define COPYRIGHT "Copyright © 2016-2021 Syping"
88
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor"
99
!define INSTALLER_NAME "gta5view_setup.exe"
1010
!define MAIN_APP_EXE "gta5view.exe"

RagePhoto.cpp

Lines changed: 72 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
* gta5view Grand Theft Auto V Profile Viewer
3-
* Copyright (C) 2020 Syping
3+
* Copyright (C) 2020-2021 Syping
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -90,15 +90,20 @@ bool RagePhoto::load()
9090
quint32 format = charToUInt32LE(uInt32Buffer);
9191

9292
if (format == static_cast<quint32>(PhotoFormat::GTA5)) {
93-
char photoHeader[256];
93+
char *photoHeader = static_cast<char*>(malloc(256));
94+
if (!photoHeader)
95+
return false;
9496
size = dataBuffer.read(photoHeader, 256);
95-
if (size != 256)
97+
if (size != 256) {
98+
free(photoHeader);
9699
return false;
100+
}
97101
for (const QChar &photoChar : utf16LEToString(photoHeader, 256)) {
98102
if (photoChar.isNull())
99103
break;
100104
p_photoString += photoChar;
101105
}
106+
free(photoHeader);
102107

103108
size = dataBuffer.read(uInt32Buffer, 4);
104109
if (size != 4)
@@ -142,11 +147,16 @@ bool RagePhoto::load()
142147
return false;
143148
quint32 t_photoSize = charToUInt32LE(uInt32Buffer);
144149

145-
char photoData[t_photoSize];
150+
char *photoData = static_cast<char*>(malloc(t_photoSize));
151+
if (!photoData)
152+
return false;
146153
size = dataBuffer.read(photoData, t_photoSize);
147-
if (size != t_photoSize)
154+
if (size != t_photoSize) {
155+
free(photoData);
148156
return false;
157+
}
149158
p_photoData = QByteArray(photoData, t_photoSize);
159+
free(photoData);
150160

151161
dataBuffer.seek(p_jsonOffset + 264);
152162
size = dataBuffer.read(markerBuffer, 4);
@@ -160,15 +170,20 @@ bool RagePhoto::load()
160170
return false;
161171
p_jsonBuffer = charToUInt32LE(uInt32Buffer);
162172

163-
char jsonBytes[p_jsonBuffer];
173+
char *jsonBytes = static_cast<char*>(malloc(p_jsonBuffer));
174+
if (!jsonBytes)
175+
return false;
164176
size = dataBuffer.read(jsonBytes, p_jsonBuffer);
165-
if (size != p_jsonBuffer)
177+
if (size != p_jsonBuffer) {
178+
free(jsonBytes);
166179
return false;
180+
}
167181
for (quint32 i = 0; i != p_jsonBuffer; i++) {
168182
if (jsonBytes[i] == '\x00')
169183
break;
170184
p_jsonData += jsonBytes[i];
171185
}
186+
free(jsonBytes);
172187
QJsonDocument t_jsonDocument = QJsonDocument::fromJson(p_jsonData);
173188
if (t_jsonDocument.isNull())
174189
return false;
@@ -186,15 +201,20 @@ bool RagePhoto::load()
186201
return false;
187202
p_titlBuffer = charToUInt32LE(uInt32Buffer);
188203

189-
char titlBytes[p_titlBuffer];
204+
char *titlBytes = static_cast<char*>(malloc(p_titlBuffer));
205+
if (!titlBytes)
206+
return false;
190207
size = dataBuffer.read(titlBytes, p_titlBuffer);
191-
if (size != p_titlBuffer)
208+
if (size != p_titlBuffer){
209+
free(titlBytes);
192210
return false;
211+
}
193212
for (const QChar &titlChar : QString::fromUtf8(titlBytes, p_titlBuffer)) {
194213
if (titlChar.isNull())
195214
break;
196215
p_titleString += titlChar;
197216
}
217+
free(titlBytes);
198218

199219
dataBuffer.seek(p_descOffset + 264);
200220
size = dataBuffer.read(markerBuffer, 4);
@@ -208,15 +228,20 @@ bool RagePhoto::load()
208228
return false;
209229
p_descBuffer = charToUInt32LE(uInt32Buffer);
210230

211-
char descBytes[p_descBuffer];
231+
char *descBytes = static_cast<char*>(malloc(p_descBuffer));
232+
if (!descBytes)
233+
return false;
212234
size = dataBuffer.read(descBytes, p_descBuffer);
213-
if (size != p_descBuffer)
235+
if (size != p_descBuffer) {
236+
free(descBytes);
214237
return false;
238+
}
215239
for (const QChar &descChar : QString::fromUtf8(descBytes, p_descBuffer)) {
216240
if (descChar.isNull())
217241
break;
218242
p_descriptionString += descChar;
219243
}
244+
free(descBytes);
220245

221246
dataBuffer.seek(p_endOfFile + 260);
222247
size = dataBuffer.read(markerBuffer, 4);
@@ -243,12 +268,17 @@ bool RagePhoto::load()
243268
return false;
244269
quint32 compressedSize = charToUInt32LE(uInt32Buffer);
245270

246-
char compressedPhotoHeader[compressedSize];
271+
char *compressedPhotoHeader = static_cast<char*>(malloc(compressedSize));
272+
if (!compressedPhotoHeader)
273+
return false;
247274
size = dataBuffer.read(compressedPhotoHeader, compressedSize);
248-
if (size != compressedSize)
275+
if (size != compressedSize) {
276+
free(compressedPhotoHeader);
249277
return false;
278+
}
250279
QByteArray t_photoHeader = QByteArray::fromRawData(compressedPhotoHeader, compressedSize);
251280
t_photoHeader = qUncompress(t_photoHeader);
281+
free(compressedPhotoHeader);
252282
if (t_photoHeader.isEmpty())
253283
return false;
254284
p_photoString = QString::fromUtf8(t_photoHeader);
@@ -268,12 +298,17 @@ bool RagePhoto::load()
268298
return false;
269299
compressedSize = charToUInt32LE(uInt32Buffer);
270300

271-
char compressedPhoto[compressedSize];
301+
char *compressedPhoto = static_cast<char*>(malloc(compressedSize));
302+
if (!compressedPhoto)
303+
return false;
272304
size = dataBuffer.read(compressedPhoto, compressedSize);
273-
if (size != compressedSize)
305+
if (size != compressedSize) {
306+
free(compressedPhoto);
274307
return false;
308+
}
275309
QByteArray t_photoData = QByteArray::fromRawData(compressedPhoto, compressedSize);
276310
p_photoData = qUncompress(t_photoData);
311+
free(compressedPhoto);
277312

278313
size = dataBuffer.read(uInt32Buffer, 4);
279314
if (size != 4)
@@ -290,12 +325,17 @@ bool RagePhoto::load()
290325
return false;
291326
compressedSize = charToUInt32LE(uInt32Buffer);
292327

293-
char compressedJson[compressedSize];
328+
char *compressedJson = static_cast<char*>(malloc(compressedSize));
329+
if (!compressedJson)
330+
return false;
294331
size = dataBuffer.read(compressedJson, compressedSize);
295-
if (size != compressedSize)
332+
if (size != compressedSize) {
333+
free(compressedJson);
296334
return false;
335+
}
297336
QByteArray t_jsonBytes = QByteArray::fromRawData(compressedJson, compressedSize);
298337
p_jsonData = qUncompress(t_jsonBytes);
338+
free(compressedJson);
299339
if (p_jsonData.isEmpty())
300340
return false;
301341
QJsonDocument t_jsonDocument = QJsonDocument::fromJson(p_jsonData);
@@ -318,12 +358,17 @@ bool RagePhoto::load()
318358
return false;
319359
compressedSize = charToUInt32LE(uInt32Buffer);
320360

321-
char compressedTitl[compressedSize];
361+
char *compressedTitl = static_cast<char*>(malloc(compressedSize));
362+
if (!compressedTitl)
363+
return false;
322364
size = dataBuffer.read(compressedTitl, compressedSize);
323-
if (size != compressedSize)
365+
if (size != compressedSize) {
366+
free(compressedTitl);
324367
return false;
368+
}
325369
QByteArray t_titlBytes = QByteArray::fromRawData(compressedTitl, compressedSize);
326370
t_titlBytes = qUncompress(t_titlBytes);
371+
free(compressedTitl);
327372
p_titleString = QString::fromUtf8(t_titlBytes);
328373

329374
size = dataBuffer.read(uInt32Buffer, 4);
@@ -341,12 +386,17 @@ bool RagePhoto::load()
341386
return false;
342387
compressedSize = charToUInt32LE(uInt32Buffer);
343388

344-
char compressedDesc[compressedSize];
389+
char *compressedDesc = static_cast<char*>(malloc(compressedSize));
390+
if (!compressedDesc)
391+
return false;
345392
size = dataBuffer.read(compressedDesc, compressedSize);
346-
if (size != compressedSize)
393+
if (size != compressedSize) {
394+
free(compressedDesc);
347395
return false;
396+
}
348397
QByteArray t_descBytes = QByteArray::fromRawData(compressedDesc, compressedSize);
349398
t_descBytes = qUncompress(t_descBytes);
399+
free(compressedDesc);
350400
p_descriptionString = QString::fromUtf8(t_descBytes);
351401

352402
size = dataBuffer.read(uInt32Buffer, 4);
@@ -382,7 +432,7 @@ bool RagePhoto::load()
382432
size = dataBuffer.read(length, 1);
383433
if (size != 1)
384434
return false;
385-
int i_length = QByteArray::number((int)length[0], 16).toInt() + 6;
435+
int i_length = QByteArray::number(static_cast<int>(length[0]), 16).toInt() + 6;
386436

387437
#if QT_VERSION >= 0x050A00
388438
size = dataBuffer.skip(i_length);

config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
#endif
4141

4242
#ifndef GTA5SYNC_COPYRIGHT
43-
#define GTA5SYNC_COPYRIGHT "2016-2020"
43+
#define GTA5SYNC_COPYRIGHT "2016-2021"
4444
#endif
4545

4646
#ifndef GTA5SYNC_APPVER
47-
#define GTA5SYNC_APPVER "1.9.1"
47+
#define GTA5SYNC_APPVER "1.9.2"
4848
#endif
4949

5050
#if __cplusplus

res/app.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ IDI_ICON1 ICON DISCARDABLE "5sync.ico"
44
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
55
#include <windows.h>
66
VS_VERSION_INFO VERSIONINFO
7-
FILEVERSION 1, 9, 1, 0
8-
PRODUCTVERSION 1, 9, 1, 0
7+
FILEVERSION 1, 9, 2, 0
8+
PRODUCTVERSION 1, 9, 2, 0
99
FILEFLAGSMASK 0x3fL
1010
FILEFLAGS 0
1111
FILEOS VOS_NT_WINDOWS32
@@ -22,12 +22,12 @@ BEGIN
2222
BEGIN
2323
VALUE "CompanyName", "Syping"
2424
VALUE "FileDescription", "gta5view"
25-
VALUE "FileVersion", "1.9.1"
25+
VALUE "FileVersion", "1.9.2"
2626
VALUE "InternalName", "gta5view"
27-
VALUE "LegalCopyright", "Copyright � 2016-2020 Syping"
27+
VALUE "LegalCopyright", "Copyright � 2016-2021 Syping"
2828
VALUE "OriginalFilename", "gta5view.exe"
2929
VALUE "ProductName", "gta5view"
30-
VALUE "ProductVersion", "1.9.1"
30+
VALUE "ProductVersion", "1.9.2"
3131
END
3232
END
3333
END

res/de.syping.gta5view.metainfo.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Copyright 2020 Syping -->
2+
<!-- Copyright 2021 Syping -->
33
<component type="desktop-application">
44
<id>de.syping.gta5view</id>
55
<launchable type="desktop-id">de.syping.gta5view.desktop</launchable>
@@ -32,6 +32,7 @@
3232
<developer_name>Syping</developer_name>
3333

3434
<releases>
35+
<release date="2021-03-22" version="1.9.2"/>
3536
<release date="2020-12-16" version="1.9.1"/>
3637
<release date="2020-11-30" version="1.9.0"/>
3738
<release date="2020-10-11" version="1.8.0"/>

res/gta5sync_fr.qm

2 Bytes
Binary file not shown.

res/gta5sync_fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V</translation>
305305
<message>
306306
<location filename="../ImportDialog.ui" line="311"/>
307307
<source>Resolution:</source>
308-
<translation>Résolution:</translation>
308+
<translation>Résolution :</translation>
309309
</message>
310310
<message>
311311
<location filename="../ImportDialog.ui" line="324"/>

0 commit comments

Comments
 (0)