mirror of
https://github.com/rvtr/unlaunch-installer_dev.git
synced 2026-01-26 13:43:08 -05:00
Gif: skip most of the known application extensions instead of ignoring them
Except the plain text one
This commit is contained in:
parent
3cf702f8f4
commit
58a2ac164f
@ -92,12 +92,6 @@ Gif getGif(std::string_view path) {
|
|||||||
switch (fgetc(file)) {
|
switch (fgetc(file)) {
|
||||||
case 0x21: { // Extension
|
case 0x21: { // Extension
|
||||||
switch (fgetc(file)) {
|
switch (fgetc(file)) {
|
||||||
case 0xF9: { // Graphics Control
|
|
||||||
uint8_t toRead = fgetc(file);
|
|
||||||
fseek(file, toRead, SEEK_CUR);
|
|
||||||
fgetc(file); // Terminator
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 0x01: { // Plain text
|
case 0x01: { // Plain text
|
||||||
throw std::runtime_error("Plain text found");
|
throw std::runtime_error("Plain text found");
|
||||||
#if 0
|
#if 0
|
||||||
@ -108,24 +102,10 @@ Gif getGif(std::string_view path) {
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
case 0xFF: { // Application extension
|
case 0xF9: // Graphics Control
|
||||||
throw std::runtime_error("Application extension found");
|
case 0xFF: // Application extension
|
||||||
#if 0
|
|
||||||
if (fgetc(file) == 0xB) {
|
|
||||||
char buffer[0xC] = {0};
|
|
||||||
fread(buffer, 1, 0xB, file);
|
|
||||||
if (strcmp(buffer, "NETSCAPE2.0") == 0) { // Check for Netscape loop count
|
|
||||||
fseek(file, 2, SEEK_CUR);
|
|
||||||
fseek(file, 2, SEEK_CUR);
|
|
||||||
fgetc(file); //terminator
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[[fallthrough]];
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
case 0xFE: { // Comment
|
case 0xFE: { // Comment
|
||||||
// Skip comments and unsupported application extionsions
|
// Skip
|
||||||
while (uint8_t size = fgetc(file)) {
|
while (uint8_t size = fgetc(file)) {
|
||||||
fseek(file, size, SEEK_CUR);
|
fseek(file, size, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user