Skip to content

Commit

Permalink
Merge pull request OSGeo#11106 from bradh/11095_fixup
Browse files Browse the repository at this point in the history
heif: protect against testing for enums that might not exist
  • Loading branch information
rouault authored Oct 25, 2024
2 parents 15589fe + ca2e047 commit cbdc8a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frmts/heif/heifdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ void GDALRegister_HEIF()
{
poDriver->SetMetadataItem("SUPPORTS_JPEG_WRITE", "YES", "HEIF");
}
#if LIBHEIF_NUMERIC_VERSION >= BUILD_LIBHEIF_VERSION(1, 15, 0)
if (heif_have_decoder_for_format(heif_compression_JPEG2000))
{
poDriver->SetMetadataItem("SUPPORTS_JPEG2000", "YES", "HEIF");
Expand All @@ -832,6 +833,8 @@ void GDALRegister_HEIF()
{
poDriver->SetMetadataItem("SUPPORTS_JPEG2000_WRITE", "YES", "HEIF");
}
#endif
#if LIBHEIF_NUMERIC_VERSION >= BUILD_LIBHEIF_VERSION(1, 18, 0)
if (heif_have_decoder_for_format(heif_compression_HTJ2K))
{
poDriver->SetMetadataItem("SUPPORTS_HTJ2K", "YES", "HEIF");
Expand All @@ -840,6 +843,8 @@ void GDALRegister_HEIF()
{
poDriver->SetMetadataItem("SUPPORTS_HTJ2K_WRITE", "YES", "HEIF");
}
#endif
#if LIBHEIF_NUMERIC_VERSION >= BUILD_LIBHEIF_VERSION(1, 16, 0)
if (heif_have_decoder_for_format(heif_compression_uncompressed))
{
poDriver->SetMetadataItem("SUPPORTS_UNCOMPRESSED", "YES", "HEIF");
Expand All @@ -849,6 +854,8 @@ void GDALRegister_HEIF()
poDriver->SetMetadataItem("SUPPORTS_UNCOMPRESSED_WRITE", "YES",
"HEIF");
}
#endif
#if LIBHEIF_NUMERIC_VERSION >= BUILD_LIBHEIF_VERSION(1, 15, 0)
if (heif_have_decoder_for_format(heif_compression_VVC))
{
poDriver->SetMetadataItem("SUPPORTS_VVC", "YES", "HEIF");
Expand All @@ -857,6 +864,7 @@ void GDALRegister_HEIF()
{
poDriver->SetMetadataItem("SUPPORTS_VVC_WRITE", "YES", "HEIF");
}
#endif
#else
// Anything that old probably supports only HEVC
poDriver->SetMetadataItem("SUPPORTS_HEVC", "YES", "HEIF");
Expand Down

0 comments on commit cbdc8a4

Please sign in to comment.