[poppler] Heap corruption caused by wrong JPXStream import

Albert Astals Cid aacid at kde.org
Sun Jul 5 04:48:42 PDT 2015


El Diumenge, 5 de juliol de 2015, a les 13:31:47, Adam Reichold va escriure:
> Hello again,
> 
> Am 05.07.2015 um 13:11 schrieb Albert Astals Cid:
> > Can you please add a few MESSAGE() in the root CMakeLists.txt (around line
> > 430) to see which of the files is getting compiled in
> 
> Since CMake can't successfully locate OpenJPEG [1], it is falling back
> to "JPXStream.cc", i.e. line 445 in "CMakeLists.txt".
> 
> > Also put something that should not compile in JPEG2000Stream.* or
> > JPXStream.* to check for the same.
> 
> And here I find that "JPEG2000Stream.h" instead of "JPXStream.cc" is
> incorrectly included for example into "Stream.cc".
> 
> > I don't understand how this can be happening but it seems that for you
> > JPEG2000Stream.cc is being compiled but JPXStream.h is being used or
> > viceversa.
> 
> I think this is due to "ENABLE_LIBOPENJPEG" being defined in "config.h"
> which would indicate that "LIBOPENJPEG_FOUND" is actually true even
> though the headers cound not be found? But from looking at the CMake
> modules I do not understand this ATM as well...

Right, can you confirm this fixes the problem?

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f77e366..1618e1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,6 +158,7 @@ if(ENABLE_ZLIB)
 endif(ENABLE_ZLIB)
 set(USE_OPENJPEG1 FALSE)
 set(USE_OPENJPEG2 FALSE)
+set(WITH_OPENJPEG FALSE)
 if(ENABLE_LIBOPENJPEG STREQUAL "auto")
   find_package(LIBOPENJPEG)
   set(USE_OPENJPEG1 ${LIBOPENJPEG_FOUND})
@@ -176,6 +177,7 @@ elseif(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2")
   set(USE_OPENJPEG2 ${LIBOPENJPEG2_FOUND})
   set(WITH_OPENJPEG ${LIBOPENJPEG2_FOUND})
 endif()
+set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}")
 if(ENABLE_CMS STREQUAL "auto")
   find_package(LCMS2)
   set(USE_CMS ${LCMS2_FOUND})

Cheers,
  Albert

> 
> Best regards, Adam.
> 
> [1] "Could NOT find LibOpenJPEG (missing:  LIBOPENJPEG_INCLUDE_DIR)"



More information about the poppler mailing list