From: Alex Tutubalin Date: Sun, 2 Mar 2025 11:35:43 +0300 Subject: additional checks in PhaseOne correction tag 0x412 processing (cherry picked from commit a50dc3f1127d2e37a9b39f57ad9bb2ebb60f18c0) --- src/decoders/load_mfbacks.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/decoders/load_mfbacks.cpp b/src/decoders/load_mfbacks.cpp index 61eedeb..db0dc74 100644 --- a/src/decoders/load_mfbacks.cpp +++ b/src/decoders/load_mfbacks.cpp @@ -336,6 +336,8 @@ int LibRaw::phase_one_correct() unsigned w0 = head[1] * head[3], w1 = head[2] * head[4]; if (w0 > 10240000 || w1 > 10240000) throw LIBRAW_EXCEPTION_ALLOC; + if (w0 < 1 || w1 < 1) + throw LIBRAW_EXCEPTION_IO_CORRUPT; yval[0] = (float *)calloc(head[1] * head[3] + head[2] * head[4], 6); merror(yval[0], "phase_one_correct()"); yval[1] = (float *)(yval[0] + head[1] * head[3]);