mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
patterns/ani: Improved compatibility with error size defined in ani files (#354)
This commit is contained in:
@@ -36,7 +36,12 @@ struct RiffChunk {
|
|||||||
u32 size;
|
u32 size;
|
||||||
if (signature == "RIFF" || signature == "LIST") {
|
if (signature == "RIFF" || signature == "LIST") {
|
||||||
char type[4];
|
char type[4];
|
||||||
RiffChunk chunks[while($ - addressof(type) < size)];
|
|
||||||
|
// Compatible with error size defined in ani files
|
||||||
|
u32 remain = sizeof($) - addressof(type);
|
||||||
|
u32 marked = size > remain ? remain : size;
|
||||||
|
|
||||||
|
RiffChunk chunks[while($ - addressof(type) < marked)];
|
||||||
} else if (signature[0] == 'I' && parent.type == "INFO") {
|
} else if (signature[0] == 'I' && parent.type == "INFO") {
|
||||||
char info[size];
|
char info[size];
|
||||||
} else if (signature == "anih") {
|
} else if (signature == "anih") {
|
||||||
|
|||||||
BIN
tests/patterns/test_data/ani.compatibility.hexpat.ani
Normal file
BIN
tests/patterns/test_data/ani.compatibility.hexpat.ani
Normal file
Binary file not shown.
Reference in New Issue
Block a user