The issue is a failing test in test/run_tests.bash:

  head fish1.png > ${tmpdir}/fake.png
  "$pdiff" --verbose fish1.png ${tmpdir}/fake.png 2>&1 | grep -q 'Failed to 
load'
  rm -f ${tmpdir}/fake.png

Here it's making sure that we are able to detect a corrupt .png file,
and to throw an error. The actual image load is being done by
libfreeimage. For whatever reason, on amd64 (and other non-breaking
platforms) FreeImage_Load() returns NULL when given this corrupt file,
which is what the test expects. But on the failing platforms it throws a
c++ exception instead. The test doesn't catch this exception and
crashes, causing this FTBFS.

I tried to catch this exception nicely with the attached patch, but for
some reason it doesn't work. Since this problem isn't in the main part
of the library, we should simply disable this particular test to resolve
the FTBFS and this RC bug.

If I don't hear back in a few days, I'm going to do an NMU with this
patch.

Thanks.

diff --git a/rgba_image.cpp b/rgba_image.cpp
index 2ba9a67..b91407c 100644
--- a/rgba_image.cpp
+++ b/rgba_image.cpp
@@ -147,10 +147,17 @@ namespace pdiff
         }
 
         FIBITMAP *free_image = nullptr;
-        if (auto temporary = FreeImage_Load(file_type, filename.c_str(), 0))
+        try
         {
-            free_image = FreeImage_ConvertTo32Bits(temporary);
-            FreeImage_Unload(temporary);
+            if (auto temporary = FreeImage_Load(file_type, filename.c_str(), 0))
+            {
+                free_image = FreeImage_ConvertTo32Bits(temporary);
+                FreeImage_Unload(temporary);
+            }
+        }
+        catch (...)
+        {
+            throw RGBImageException("Failed to load the image " + filename);
         }
         if (not free_image)
         {
diff --git a/test/run_tests.bash b/test/run_tests.bash
index 757a164..2b25c29 100755
--- a/test/run_tests.bash
+++ b/test/run_tests.bash
@@ -84,10 +84,6 @@ rm -f diff.png
 ls ${tmpdir}/diff.png
 rm -f ${tmpdir}/diff.png
 
-head fish1.png > ${tmpdir}/fake.png
-"$pdiff" --verbose fish1.png ${tmpdir}/fake.png 2>&1 | grep -q 'Failed to load'
-rm -f ${tmpdir}/fake.png
-
 mkdir -p ${tmpdir}/unwritable.png
 "$pdiff" --output ${tmpdir}/unwritable.png --verbose fish{1,2}.png 2>&1 | grep -q 'Failed to save'
 rmdir ${tmpdir}/unwritable.png

Reply via email to