Issue #4185: Plug-in “file-heif.exe” crashes exporting HEIF/HEIC.

My previous test (commit 41285813a5) was a bit misinformed. So it turns
out bug #4185 is for all platforms and the broken libheif versions are
1.5.0 and 1.5.1 only.

So my new test (platform independent) is: prefer libheif versions with
profile support, except 1.5.x; then prefer lower versions without
profile support; and only as last resort accept 1.5.x versions (but
output a warning).
This commit is contained in:
Jehan 2019-11-13 12:33:14 +01:00
parent d1bb192d7d
commit f051e6d238
1 changed files with 31 additions and 20 deletions

View File

@ -1788,45 +1788,56 @@ AM_CONDITIONAL(HAVE_WEBP, test "x$have_webp" = xyes)
AC_ARG_WITH(libheif, [ --without-libheif build without libheif support]) AC_ARG_WITH(libheif, [ --without-libheif build without libheif support])
# Overcomplex tests, but basically:
# - Profiles supported only for libheif >= 1.4.0.
# - libheif 1.5.0 and 1.5.1 are very broken and easily crash.
# As a consequence we prioritize any libheif other than these 2 versions
# (even when under 1.4.0 thus we lose profile support), and only use
# these as last resort, outputting a warning.
have_libheif=no have_libheif=no
have_libheif_1_4_0=no have_libheif_1_4_0=no
have_libheif_1_6_0=no
if test "x$with_libheif" != xno; then if test "x$with_libheif" != xno; then
have_libheif_1_4_0=yes have_libheif_1_4_0=yes
have_libheif_1_6_0=yes
have_libheif=yes have_libheif=yes
PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.6.0,, PKG_CHECK_MODULES(LIBHEIF, libheif > 1.5.1,,
[ [
have_libheif_1_6_0="no (libheif >= 1.6.0 not found)" PKG_CHECK_MODULES(LIBHEIF, libheif = 1.4.0,,
PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.4.0,,
[ [
have_libheif_1_4_0="no (libheif >= 1.4.0 not found)" have_libheif_1_4_0="no (libheif >= 1.4.0 not found)"
PKG_CHECK_MODULES(LIBHEIF, libheif >= libheif_required_version, PKG_CHECK_MODULES(LIBHEIF, libheif = libheif_required_version,,
FILE_HEIF='file-heif$(EXEEXT)', [
[have_libheif="no (libheif not found)"]) PKG_CHECK_MODULES(LIBHEIF, libheif >= 1.5.0,
[
have_libheif_1_4_0=yes
warning_libheif="
WARNING: libheif version 1.5.0 and 1.5.1 are known to crash when
exporting (bug #4185). Please update."
],
[ have_libheif="no (libheif not found)" ])
])
]) ])
]) ])
fi fi
if test "x$have_libheif" = xyes; then
FILE_HEIF='file-heif$(EXEEXT)',
fi
AC_SUBST(FILE_HEIF) AC_SUBST(FILE_HEIF)
AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes) AM_CONDITIONAL(HAVE_LIBHEIF, test "x$have_libheif" = xyes)
if test "x$have_libheif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
have_libheif="yes [[profile support: $have_libheif_1_4_0]]"
fi
if test "x$have_libheif_1_4_0" = xyes; then if test "x$have_libheif_1_4_0" = xyes; then
AC_DEFINE(HAVE_LIBHEIF_1_4_0, 1, AC_DEFINE(HAVE_LIBHEIF_1_4_0, 1,
[Define to 1 if libheif >= 1.4.0 is available]) [Define to 1 if libheif >= 1.4.0 is available])
if test "x$warning_libheif" != "x"; then
have_libheif_1_4_0="yes (see warning below)"
fi
fi fi
if test "x$have_libheif_1_6_0" = xyes; then
AC_DEFINE(HAVE_LIBHEIF_1_6_0, 1, if test "x$have_libheif" = xyes; then
[Define to 1 if libheif >= 1.6.0 is available]) MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
elif test "x$platform_win32" = xyes || test "x$platform_osx" = xyes; then have_libheif="yes [[profile support: $have_libheif_1_4_0]]"
warning_libheif="
WARNING: libheif lower than version 1.6.0 are known to crash when
exporting on Windows and macOS (bug #4185). Please update."
fi fi