Skip to content

Commit

Permalink
Merge pull request #438 from JeromeMartinez/DPX_version_null
Browse files Browse the repository at this point in the history
Accept null bytes in DPX version
  • Loading branch information
JeromeMartinez authored Jun 27, 2024
2 parents 50ab86c + 2459843 commit 8cd7975
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions Project/GNU/CLI/test/test1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Formats/DPX/Flavors/Y_16_FilledA_BE/0000001.dpx pass
Formats/DPX/Flavors/Y_16_Packed_BE/FFmpeg_gray16be.dpx pass
Formats/DPX/Flavors/Y_16_Packed_LE/FFmpeg_gray16le.dpx pass
Formats/DPX/Conformance/0004_OffsetToImageData/0004_OffsetToImageData_000000.dpx fail
Formats/DPX/Conformance/0008_VersionNumber/0008_VersionNumber_null.dpx pass
Formats/DPX/Conformance/0008_VersionNumber/0008_VersionNumber_v.dpx pass
Formats/EXR/Features/Compressed/PXR24/AllHalfValues.exr fail
Formats/EXR/Flavors/RGB_16F/Color_Test_Chart_LogC_400ASA_3200k.cpu.00.exr pass
Expand Down
9 changes: 6 additions & 3 deletions Source/Lib/Uncompressed/DPX/DPX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ void dpx::ParseBuffer()
uint64_t VersionNumberBig = Get_B4();
switch (VersionNumberBig)
{
case 0x00000000LL: // Not conform to spec but it exists and it does not hurt
case 0x56312E30LL:
case 0x56322E30LL:
case 0x76312E30LL:
Expand Down Expand Up @@ -638,10 +639,12 @@ void dpx::ConformanceCheck()
uint32_t OffsetToImageData = Get_X4();
if (OffsetToImageData < 1664 || OffsetToImageData > Buffer.Size())
Invalid(invalid::OffsetToImageData);
uint64_t VersionNumber = Get_B8() >> 24;
switch (VersionNumber)
uint64_t VersionNumberBig = Get_B4();
switch (VersionNumberBig)
{
case 0x76312E3000LL:
case 0x00000000LL:
case 0x76312E30LL:
case 0x76322E30LL:
Invalid(invalid::VersionNumber);
default:;
}
Expand Down

0 comments on commit 8cd7975

Please sign in to comment.