issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "strukturag", "libheif" ]
Hi I download the code and compile on my Mac. What I can see is: --- ./examples/heif-info /Users/xxxxxx/Downloads/IMG_0024.HEIC MIME type: image/heic main brand: heic compatible brands: mif1, MiHE, MiPr, miaf, MiHB, heic image: 3024x4032 (id=49), primary colorspace: YCbCr, 4:2:0 bit depth: 8 thumbnail: 240x320 color profile: prof alpha channel: no depth channel: no metadata: Exif: 2838 bytes transformations: angle (ccw): 270 region annotations: none properties: Could not decode image Error while loading plugin: No decoding plugin installed for this compression format --- ./examples/heif-dec --list HEIC decoders: VVIC decoders: AVIF decoders: JPEG decoders: JPEG 2000 decoders: HT-J2K decoders: uncompressed: yes There is no libde265 but I had install it before. What should I do next?
No decoding plugin installed for this compression format
https://api.github.com/repos/strukturag/libheif/issues/1250/comments
2
2024-07-24T08:28:20Z
2024-07-25T03:11:14Z
https://github.com/strukturag/libheif/issues/1250
2,426,918,769
1,250
[ "strukturag", "libheif" ]
Hello, Since the update to 1.18.0 we are having an issue to package it on Gentoo. We build the packages on a build directory and, once everything is installed there, we proceed to effectively moving everything under the real file system (controlled by our package manager). With the new 1.18.0 version, it seems that cmake tries to directly modify the real filesystem. As a consequence, our sandbox system blocks the create_symlink call and causes the build to fail: https://github.com/gentoo/gentoo/pull/36951#issuecomment-2237372033 Supposedly, this could be fixed making create_symlink to honor the DESTDIR variable (as all the other install scripts are doing), but I am not familiar enough with cmake to modify it :S https://github.com/strukturag/libheif/blob/master/examples/CMakeLists.txt#L37 Thanks for your help
libheif-1.8.0: create_symlink tries to directly modify real file system instead of building dir
https://api.github.com/repos/strukturag/libheif/issues/1249/comments
10
2024-07-21T08:15:59Z
2024-08-10T10:42:18Z
https://github.com/strukturag/libheif/issues/1249
2,421,286,067
1,249
[ "strukturag", "libheif" ]
`heif_item_get_property_raw_data()` appears to include the flags / version, but not the extended type field (i.e. the UUID for the `uuid` box case). Without the UUID, its hard to tell which UUID box is being returned.
heif_item_get_property_raw_data() should include the UUID for uuid boxes
https://api.github.com/repos/strukturag/libheif/issues/1244/comments
6
2024-07-16T10:58:03Z
2024-07-20T08:25:57Z
https://github.com/strukturag/libheif/issues/1244
2,410,849,222
1,244
[ "strukturag", "libheif" ]
Hi, I am a Canon user and my camera produces 10 bit HIF files. The use of these files is (currently) heavily limited on Android, e.g., Google Photos, WhatsApp,... don't support it. I checked and tested that AVIF (10 bit) is however supportet by these apps. Might a conversion feature for HEIF to AVIF be of interest to other users? Here a HIF file example: [example](https://github.com/user-attachments/files/15759323/20240525_162308_IMG_0009.zip)
HEIF (10 bit) to AVIF (10 bit) conversion, e.g., for Android compatibility
https://api.github.com/repos/strukturag/libheif/issues/1241/comments
0
2024-07-11T21:09:50Z
2024-07-11T21:10:31Z
https://github.com/strukturag/libheif/issues/1241
2,404,131,291
1,241
[ "strukturag", "libheif" ]
On just released 1.18.0, both 64-bit and 32-bit: ``` C:/msys64/home/kmilos/MINGW-packages/mingw-w64-libheif/src/libheif-1.18.0/examples/decoder_tiff.cc:136:22: warning: conversion from 'toff_t' {aka 'long long unsigned int'} to 'off_t' {aka 'long int'} may change value [-Wconversion] 136 | if (!seekTIFF(tif, exif_offset, SEEK_SET)) { | ^~~~~~~~~~~ ```
Type conversion warning on new TIFF decoder
https://api.github.com/repos/strukturag/libheif/issues/1235/comments
3
2024-07-10T12:05:11Z
2024-07-10T13:36:30Z
https://github.com/strukturag/libheif/issues/1235
2,400,581,741
1,235
[ "strukturag", "libheif" ]
Using GCC 9.3 and just got the folloving errors: ``` [73/81] Linking CXX executable tests/encode FAILED: tests/encode : && /usr/bin/g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -march=native -mtune=native -fasynchronous-unwind-tables -mno-aes -w -O2 -g -DNDEBUG tests/CMakeFiles/encode.dir/main.cc.o tests/CMakeFiles/encode.dir/__/generated/test-config.cc.o tests/CMakeFiles/encode.dir/test_utils.cc.o tests/CMakeFiles/encode.dir/encode.cc.o -o tests/encode -Wl,-rpath,/home/elijah/.local/rpmbuild/BUILD/libheif/x86_64-redhat-linux-gnu/libheif libheif/libheif.so.1.18.0 && : /usr/bin/ld: libheif/libheif.so.1.18.0: undefined reference to `typeinfo for Box_cmpC' /usr/bin/ld: libheif/libheif.so.1.18.0: undefined reference to `typeinfo for Box_icbr' ```
Unable to build current "master" branch
https://api.github.com/repos/strukturag/libheif/issues/1229/comments
1
2024-07-09T15:05:48Z
2024-07-09T15:13:35Z
https://github.com/strukturag/libheif/issues/1229
2,398,466,870
1,229
[ "strukturag", "libheif" ]
## Overview Due to insufficient validation of image overlay offset values, it is possible to OOB read & write in `HeifPixelImage::overlay()`. ## Reproduction This vulnerability exists on both master (7c9729ea8d0f319ab423f8e4e6de121fd78596d0) and develop-v1.18.0 (44a9705568a18955230ad9d2b5de4d2682dd50f9). ``` git clone https://github.com/strukturag/libheif.git cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake .. make -j # OOB read examples/heif-info poc_oob_read.heic # OOB write examples/heif-info poc_oob_write.heic ``` Download from google drive: [poc_oob_read.heic](https://drive.google.com/file/d/1oo69R3N4luXzCcXeJYtL-v11KGFYHq57/view?usp=sharing) [poc_oob_write.heic](https://drive.google.com/file/d/1nnTP4GGB7K1CQJDzeLybHlWwoVpwYuT4/view?usp=sharing) ### Asan logs OOB read: ``` ==169466==ERROR: AddressSanitizer: negative-size-param: (size=-2147482208) #0 0x7ffff76053ff in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827 #1 0x7ffff73b61e0 in HeifPixelImage::overlay(std::shared_ptr<HeifPixelImage>&, int, int) (clean_build/libheif/build/libheif/libheif.so.1+0x1b61e0) #2 0x7ffff733cabc in HeifContext::decode_overlay_image(unsigned int, std::shared_ptr<HeifPixelImage>&, std::vector<unsigned char, std::allocator<unsigned char> > const&, heif_decoding_options const&) const (clean_build/libheif/build/libheif/libheif.so.1+0x13cabc) #3 0x7ffff7333f60 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const (clean_build/libheif/build/libheif/libheif.so.1+0x133f60) #4 0x7ffff7331450 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const (clean_build/libheif/build/libheif/libheif.so.1+0x131450) #5 0x7ffff72eb0d9 in heif_decode_image (clean_build/libheif/build/libheif/libheif.so.1+0xeb0d9) #6 0x5555555625f2 in main (clean_build/libheif/build/examples/heif-info+0xe5f2) #7 0x7ffff6ccdd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #8 0x7ffff6ccde3f in __libc_start_main_impl ../csu/libc-start.c:392 #9 0x55555555c304 in _start (clean_build/libheif/build/examples/heif-info+0x8304) ``` OOB write: ``` ==169585==ERROR: AddressSanitizer: SEGV on unknown address 0x62e080000400 (pc 0x7ffff6d68ae3 bp 0x7fffffffbc00 sp 0x7fffffffb9b8 T0) ==169585==The signal is caused by a WRITE memory access. #0 0x7ffff6d68ae3 (/lib/x86_64-linux-gnu/libc.so.6+0xc4ae3) #1 0x7ffff73b61e0 in HeifPixelImage::overlay(std::shared_ptr<HeifPixelImage>&, int, int) (clean_build/libheif/build/libheif/libheif.so.1+0x1b61e0) #2 0x7ffff733cabc in HeifContext::decode_overlay_image(unsigned int, std::shared_ptr<HeifPixelImage>&, std::vector<unsigned char, std::allocator<unsigned char> > const&, heif_decoding_options const&) const (clean_build/libheif/build/libheif/libheif.so.1+0x13cabc) #3 0x7ffff7333f60 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const (clean_build/libheif/build/libheif/libheif.so.1+0x133f60) #4 0x7ffff7331450 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const (clean_build/libheif/build/libheif/libheif.so.1+0x131450) #5 0x7ffff72eb0d9 in heif_decode_image (clean_build/libheif/build/libheif/libheif.so.1+0xeb0d9) #6 0x5555555625f2 in main (clean_build/libheif/build/examples/heif-info+0xe5f2) #7 0x7ffff6ccdd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #8 0x7ffff6ccde3f in __libc_start_main_impl ../csu/libc-start.c:392 #9 0x55555555c304 in _start (clean_build/libheif/build/examples/heif-info+0x8304) ``` ### Environment ``` OS: Ubuntu 22.04 gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ## Root cause The overlay offsets specified in the iloc box are trusted by the program. While there are "sanity" checks in `HeifPixelImage::overlay()`, these checks can be bypassed with extremely large or extremely small offsets. For instance, in `poc_oob_write.heic`, the x offset (`dx`) is `INT_MAX - 10`. The OOB write arises from an integer overflow in this [check](https://github.com/strukturag/libheif/blob/7c9729ea8d0f319ab423f8e4e6de121fd78596d0/libheif/pixelimage.cc#L786): ```c // overlay image extends past the right border -> cut width for copy if (dx + in_w > out_w) { in_w = out_w - dx; } ``` In `poc_oob_read.heic`, `dx` is `INT_MIN`. The OOB read arises from the UB in this [check](https://github.com/strukturag/libheif/blob/7c9729ea8d0f319ab423f8e4e6de121fd78596d0/libheif/pixelimage.cc#L810): ```c // overlay image started outside of left border // -> move start into the image and start at left output column if (dx < 0) { in_x0 = -dx; out_x0 = 0; } ``` ## Mitigation A simple fix would be to check that `in_y0/x0` and `out_x0/y0` are within the bounds of the respective images' dimensions before using the values at the end of the function.
OOB Read/Write in `HeifPixelImage::overlay()`
https://api.github.com/repos/strukturag/libheif/issues/1226/comments
2
2024-07-07T09:16:35Z
2024-07-08T10:27:14Z
https://github.com/strukturag/libheif/issues/1226
2,393,967,067
1,226
[ "strukturag", "libheif" ]
I noticed that ppa builds are missing for Ubuntu 24.04. Any chance they can be added? 24.04 is a LTS release.
ppa builds for Ubuntu noble 24.04
https://api.github.com/repos/strukturag/libheif/issues/1225/comments
0
2024-07-06T13:57:02Z
2024-07-06T13:57:02Z
https://github.com/strukturag/libheif/issues/1225
2,393,571,543
1,225
[ "strukturag", "libheif" ]
``` /buildstream-build/libheif/plugins/encoder_svt.cc: In function ‘heif_error svt_encode_image(void*, const heif_image*, heif_image_input_class)’: /buildstream-build/libheif/plugins/encoder_svt.cc:654:34: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbColorPrimaries’ [-fpermissive] 654 | svt_config.color_primaries = static_cast<uint8_t>(nclx->color_primaries); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | uint8_t {aka unsigned char} /buildstream-build/libheif/plugins/encoder_svt.cc:655:43: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbTransferCharacteristics’ [-fpermissive] 655 | svt_config.transfer_characteristics = static_cast<uint8_t>(nclx->transfer_characteristics); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | uint8_t {aka unsigned char} /buildstream-build/libheif/plugins/encoder_svt.cc:656:38: error: invalid conversion from ‘uint8_t’ {aka ‘unsigned char’} to ‘EbMatrixCoefficients’ [-fpermissive] 656 | svt_config.matrix_coefficients = static_cast<uint8_t>(nclx->matrix_coefficients); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | uint8_t {aka unsigned char} /buildstream-build/libheif/plugins/encoder_svt.cc:657:52: error: invalid conversion from ‘int’ to ‘EbColorRange’ [-fpermissive] 657 | svt_config.color_range = nclx->full_range_flag ? 1 : 0; | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ | | | int ``` Build config: ``` cmake -B_builddir -H"." -G"Ninja" -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_INSTALL_PREFIX:PATH="/usr" \ -DCMAKE_INSTALL_LIBDIR:PATH="lib/x86_64-linux-gnu" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS_RELWITHDEBINFO="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-DNDEBUG" -DENABLE_PLUGIN_LOADING=ON -DPLUGIN_DIRECTORY="/usr/lib/x86_64-linux-gnu/ffmpeg" -DWITH_LIBDE265_PLUGIN="OFF" -DWITH_X265_PLUGIN="OFF" -DWITH_DAV1D=ON -DWITH_DAV1D_PLUGIN=OFF -DWITH_AOM_ENCODER=ON -DWITH_AOM_ENCODER_PLUGIN=OFF -DWITH_AOM_DECODER=ON -DWITH_AOM_DECODER_PLUGIN=OFF -DWITH_JPEG_DECODER=ON -DWITH_JPEG_DECODER_PLUGIN=OFF -DWITH_JPEG_ENCODER=ON -DWITH_JPEG_ENCODER_PLUGIN=OFF -DWITH_OpenJPEG_DECODER=ON -DWITH_OpenJPEG_DECODER_PLUGIN=OFF -DWITH_OpenJPEG_ENCODER=ON -DWITH_OpenJPEG_ENCODER_PLUGIN=OFF -DWITH_SvtEnc=ON -DWITH_SvtEnc_PLUGIN=OFF -DWITH_EXAMPLES=OFF -DBUILD_TESTING=OFF -DENABLE_PLUGIN_LOADING=ON -DPLUGIN_DIRECTORY="/usr/lib/x86_64-linux-gnu/ffmpeg" -DWITH_LIBDE265_PLUGIN="OFF" -DWITH_X265_PLUGIN="OFF" -DWITH_DAV1D=ON -DWITH_DAV1D_PLUGIN=OFF -DWITH_AOM_ENCODER=ON -DWITH_AOM_ENCODER_PLUGIN=OFF -DWITH_AOM_DECODER=ON -DWITH_AOM_DECODER_PLUGIN=OFF -DWITH_JPEG_DECODER=ON -DWITH_JPEG_DECODER_PLUGIN=OFF -DWITH_JPEG_ENCODER=ON -DWITH_JPEG_ENCODER_PLUGIN=OFF -DWITH_OpenJPEG_DECODER=ON -DWITH_OpenJPEG_DECODER_PLUGIN=OFF -DWITH_OpenJPEG_ENCODER=ON -DWITH_OpenJPEG_ENCODER_PLUGIN=OFF -DWITH_SvtEnc=ON -DWITH_SvtEnc_PLUGIN=OFF -DWITH_EXAMPLES=OFF -DBUILD_TESTING=OFF -DWITH_GDK_PIXBUF=ON ``` Using svt-av1 2.1.2
Build with svt-av1 fails with GCC 14.1
https://api.github.com/repos/strukturag/libheif/issues/1223/comments
1
2024-07-05T07:30:54Z
2024-07-05T07:44:53Z
https://github.com/strukturag/libheif/issues/1223
2,392,019,987
1,223
[ "strukturag", "libheif" ]
Currently, libheif checks the `ispe` image size against the security limit. However, this does not catch the case when the `ispe` content is fake and not matching the encoded image data. We would have to pass the maximum image size to the decoder plugin and in each plugin check the compressed image size before actually starting the decoding. This is only possible if the decoding library supports this.
Forward maximum image size to decoder plugins
https://api.github.com/repos/strukturag/libheif/issues/1220/comments
0
2024-07-04T11:43:28Z
2024-07-04T11:43:28Z
https://github.com/strukturag/libheif/issues/1220
2,390,671,677
1,220
[ "strukturag", "libheif" ]
I have been looking into improving heic decoding performance. My use case is: * Input: YUV420 HEVC, multiple tile * Output: RGB interlaced In my benchmark with hacky implementation with libyuv (see the question below about why libyuv) and fixing the separate RGB channel to interlaced RGB conversion, my numbers are roughly: * 42ms with ffmpeg decoder plugin (and libheif yuv2rgb conversion) * 30ms with ffmpeg decoder plugin + libyuv for yuv2rgh interlaced conversion Questions: * Does it make sense to use libyuv for yuv2rgb conversion? sharpyuv doesn't do yuv2rgb. The other alternative is libswscale (from ffmpeg), but following ffmpeg-devel mailing list, it has not been getting much love until recently and there is some suggestion that libyuv performs better than libswscale https://ffmpeg.org/pipermail/ffmpeg-devel/2024-June/330395.html * Is the logic to default to using chroma_444 in decode_image_planar intentional? Is there any objection to change it to depend on out_chroma instead? Thanks
Improving heif decoding performance
https://api.github.com/repos/strukturag/libheif/issues/1215/comments
0
2024-07-01T18:09:07Z
2024-07-01T18:09:07Z
https://github.com/strukturag/libheif/issues/1215
2,384,446,021
1,215
[ "strukturag", "libheif" ]
When attempting to identify (or otherwise work with) the attached file, I receive the following error. I'm running a build from commit 7a8c58e4be8b3eb77d82330a407a7f5e6da15a44 (couple days ago). The image is from iOS 18 developer beta 2. ``` MIME type: image/heic main brand: heic compatible brands: mif1, MiHB, MiHE, MiPr, miaf, heic, tmap Could not read HEIF/AVIF file: Invalid input: Non-existing item ID referenced: Non-existing depth image referenced ``` Other images from iOS 18 on the same phone (but possibly from the 1st developer beta) work fine with this build (but did not with the latest official release, as detailed in #1190). [img_2314.heic.zip](https://github.com/user-attachments/files/16053119/img_2314.heic.zip)
More iOS 18 format trouble - Non-existing depth image referenced
https://api.github.com/repos/strukturag/libheif/issues/1213/comments
8
2024-07-01T12:45:14Z
2024-07-10T20:16:51Z
https://github.com/strukturag/libheif/issues/1213
2,383,757,705
1,213
[ "strukturag", "libheif" ]
The AOM encoder currently defaults to 4 threads and limits to 16 threads: https://github.com/strukturag/libheif/blob/ddb541afdbe8dadfada4536077b8e4af1bb34b5e/libheif/plugins/encoder_aom.cc#L237-L246 Is there a reason for exactly these values or could we default to "number of cpu threads" and limit to a higher value for systems with more than 16 cores? CC @wantehchang
Number of threads for AOM encoder limited
https://api.github.com/repos/strukturag/libheif/issues/1212/comments
2
2024-07-01T08:45:56Z
2024-07-04T13:08:51Z
https://github.com/strukturag/libheif/issues/1212
2,383,229,455
1,212
[ "strukturag", "libheif" ]
@bradh I got a fuzzer hitting an integer overflow: ```` libheif/codecs/uncompressed_box.cc:263:38: runtime error: unsigned integer overflow: 4294967295 + 1 cannot be represented in type 'unsigned int' ```` https://github.com/strukturag/libheif/blob/9d4a5107c469c76fec7146b896819bc215a66fbe/libheif/codecs/uncompressed_box.cc#L263-265 Probably, it is enough to output an error when the number of tiles exceeds a sensible maximum.
Integer overflow in uncompressed_box.cc
https://api.github.com/repos/strukturag/libheif/issues/1206/comments
3
2024-06-28T10:50:56Z
2024-07-05T09:36:49Z
https://github.com/strukturag/libheif/issues/1206
2,380,141,842
1,206
[ "strukturag", "libheif" ]
My understanding is that when attempting to decode heic to an output colorspace (such as RGB), libheif does this: * Use plugin to decode * Each plugin has its own decode buffer to decode to and call into heif_image_add_plane to allocate for each plane and then memcpy from the decode buffer into the heif image plane buffer * Color conversion (such as from YUV420 to RGB): another heif_image has to allocate buffer and the color conversion happens Is there a need to memcpy from decoder buffer into heif image plane buffer? In theory, there isn't a need to do so, there is just a need to support custom memory (how to scan through the data for color conversion). This should improve heif decoding performance. The above is just my surface understanding of libheif. Let me know if it makes sense.
Reuse decoder buffer (instead of alloc + memcpy)
https://api.github.com/repos/strukturag/libheif/issues/1202/comments
4
2024-06-27T18:50:41Z
2024-06-28T01:29:50Z
https://github.com/strukturag/libheif/issues/1202
2,378,879,426
1,202
[ "strukturag", "libheif" ]
Currently, the quality factor is specific to each codec (even each encoder). Investigate whether it is possible to find a comparable quality scale over all codecs. #1136
Comparable quality scale
https://api.github.com/repos/strukturag/libheif/issues/1200/comments
0
2024-06-26T22:54:35Z
2024-06-26T22:54:35Z
https://github.com/strukturag/libheif/issues/1200
2,376,402,674
1,200
[ "strukturag", "libheif" ]
Some codecs support images composed of tiles at the codec level (ISO 23001-17, h.265). Is there any use-case to support this for writing and fast access or would it be easier to just use the HEIF tiling mechanism and consider each coded image as a unit? Note: clearly, we should support tiles in the codec when reading the image. The question is only whether we should provide some means to control the tiling at the codec level when writing the image and whether we should provide some means to decode these images only partially. #1180
Image grids at the codec level
https://api.github.com/repos/strukturag/libheif/issues/1197/comments
7
2024-06-25T20:05:35Z
2024-07-19T10:54:40Z
https://github.com/strukturag/libheif/issues/1197
2,373,568,483
1,197
[ "strukturag", "libheif" ]
The Go language binding is currently is a deserted state. I am no Go user and thus I do not plan to maintain this in the future. Is anybody interested in maintaining the Go language bindings? This could be either within the libheif repository as it is now, or we could move the Go bindings to a different repository under maintainer control.
Go language binding maintainer needed
https://api.github.com/repos/strukturag/libheif/issues/1196/comments
3
2024-06-25T19:27:14Z
2024-08-10T21:26:46Z
https://github.com/strukturag/libheif/issues/1196
2,373,491,015
1,196
[ "strukturag", "libheif" ]
cmin box is a fullbox that owns its flags definitions, but I don't find the spec from ISO 23008-12 or 14496-12. I got a heic image that its version-flags bytes are: 00 00 1D 00 but when I set_intrinsic_matrix(), the flags are always 00 00 13 00 I don't know how to manage it. Is there a hint for me?
"cmin" box header flags meaning
https://api.github.com/repos/strukturag/libheif/issues/1191/comments
5
2024-06-19T09:42:38Z
2024-06-21T01:09:13Z
https://github.com/strukturag/libheif/issues/1191
2,361,889,491
1,191
[ "strukturag", "libheif" ]
I found that the heic format photos taken by **iPhone15 pro** under **iOS18** cannot be converted to jpg by **heif-convert** libheif version: 1.17.6 Here are some logs: ```bash nero@d2c24395c402:/upload# heif-convert IMG_1159.HEIC 1.jpg Could not read HEIF/AVIF file: Invalid input: Unspecified: Too many auxiliary image references nero@d2c24395c402:/upload# heif-info IMG_1159.HEIC MIME type: image/heic main brand: heic compatible brands: tmap, heic, mif1 Could not read HEIF/AVIF file: Invalid input: Unspecified: Too many auxiliary image references ``` When the iPhone 15 Pro system is still iOS17, the HEIC photos taken can be converted to JPG using the above command. The file can be downloaded via the link below: [IMG_1159.zip](https://github.com/user-attachments/files/15864812/IMG_1159.zip) https://drive.google.com/file/d/1kEBvALrnM0EUwkQzsg8YL0Pwd8ZpRWWO/view?usp=sharing
Unable to convert heic to jpg taken by iPhone 15 pro iOS18
https://api.github.com/repos/strukturag/libheif/issues/1190/comments
13
2024-06-17T09:44:48Z
2024-08-06T08:27:11Z
https://github.com/strukturag/libheif/issues/1190
2,356,896,036
1,190
[ "strukturag", "libheif" ]
Hi, I use heif_convert command(from libheif example) to convert below heif image to jpg/png. The output image color incorrect which seems too green [1040g008313u8g0qp1m4g5nkalku094d2qla98k0 2.heic.zip](https://github.com/user-attachments/files/15837489/1040g008313u8g0qp1m4g5nkalku094d2qla98k0.2.heic.zip)
heic image decode color incorrect
https://api.github.com/repos/strukturag/libheif/issues/1189/comments
11
2024-06-14T11:42:20Z
2024-06-18T08:01:10Z
https://github.com/strukturag/libheif/issues/1189
2,353,189,459
1,189
[ "strukturag", "libheif" ]
Hello all, I tried the [demo ](https://strukturag.github.io/libheif/) (version 1.16.2) to convert a [HIF file (10 bit) ](https://we.tl/t-sgYLO9lAY7) to JPG. The conversion went smoothly, however, I noticed two things : 1) No tone mapping has been applied (JPG image looks flat) and 2) All EXIF have been lost. Is this an expected behaviour and is it still present in the newest release?
Canon HIF (10 bit) Conversion to JPG : Tone Mapping & EXIF
https://api.github.com/repos/strukturag/libheif/issues/1183/comments
11
2024-06-09T18:32:15Z
2024-06-13T15:09:00Z
https://github.com/strukturag/libheif/issues/1183
2,342,418,813
1,183
[ "strukturag", "libheif" ]
Now that kvazaar is available in Debian (https://packages.debian.org/source/sid/kvazaar), I want to enable the kvazaar plugin there. Unfortunately the encode tests are failing now: ``` ./tests/encode.cc:154: FAILED: REQUIRE( ispe_width == expected_ispe_width ) with expansion: 128 == 122 ``` Full log: <details> ``` Start testing: May 27 13:13 UTC ---------------------------------------------------------- 1/4 Testing: encode 1/4 Test: encode Command: "/tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests/encode" Directory: /tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests "encode" start time: May 27 13:13 UTC Output: ---------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ encode is a Catch v2.13.9 host application. Run with -? for options ------------------------------------------------------------------------------- ispe odd size ------------------------------------------------------------------------------- ./tests/encode.cc:165 ............................................................................... ./tests/encode.cc:154: FAILED: REQUIRE( ispe_width == expected_ispe_width ) with expansion: 128 == 122 =============================================================================== test cases: 1 | 1 failed assertions: 5 | 4 passed | 1 failed <end of output> Test time = 0.04 sec ---------------------------------------------------------- Test Failed. "encode" end time: May 27 13:13 UTC "encode" time elapsed: 00:00:00 ---------------------------------------------------------- 2/4 Testing: region 2/4 Test: region Command: "/tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests/region" Directory: /tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests "region" start time: May 27 13:13 UTC Output: ---------------------------------------------------------- =============================================================================== All tests passed (191 assertions in 5 test cases) <end of output> Test time = 0.17 sec ---------------------------------------------------------- Test Passed. "region" end time: May 27 13:13 UTC "region" time elapsed: 00:00:00 ---------------------------------------------------------- 3/4 Testing: uncompressed_decode 3/4 Test: uncompressed_decode Command: "/tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests/uncompressed_decode" Directory: /tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests "uncompressed_decode" start time: May 27 13:13 UTC Output: ---------------------------------------------------------- =============================================================================== All tests passed (2527 assertions in 8 test cases) <end of output> Test time = 0.03 sec ---------------------------------------------------------- Test Passed. "uncompressed_decode" end time: May 27 13:13 UTC "uncompressed_decode" time elapsed: 00:00:00 ---------------------------------------------------------- 4/4 Testing: uncompressed_encode 4/4 Test: uncompressed_encode Command: "/tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests/uncompressed_encode" Directory: /tmp/buildd/libheif-1.17.6/obj-x86_64-linux-gnu/tests "uncompressed_encode" start time: May 27 13:13 UTC Output: ---------------------------------------------------------- =============================================================================== All tests passed (175 assertions in 20 test cases) <end of output> Test time = 0.39 sec ---------------------------------------------------------- Test Passed. "uncompressed_encode" end time: May 27 13:13 UTC "uncompressed_encode" time elapsed: 00:00:00 ---------------------------------------------------------- End testing: May 27 13:13 UTC ``` </details> If I remove the `libheif-kvazaar.so` file, the tests are passing. @farindk not sure how to fix this properly for all cases (with / without kvazaar).
Encode tests failing with kvazaar plugin available
https://api.github.com/repos/strukturag/libheif/issues/1178/comments
1
2024-05-27T13:21:36Z
2024-06-17T17:51:48Z
https://github.com/strukturag/libheif/issues/1178
2,319,149,525
1,178
[ "strukturag", "libheif" ]
I saw the code do ImageGrid::write() but I don't know how to use it. I think this is related with Box_iref, iloc and iinf box. Is there spec or handbook to do this? I have 23008-12 and 14496-12 spec but don't understand how this works.. Could somebody give me some hint? And is iref_box can reference to single image encoding, not grid?
How to create a grid HEIF
https://api.github.com/repos/strukturag/libheif/issues/1176/comments
1
2024-05-23T13:08:09Z
2024-06-25T18:19:11Z
https://github.com/strukturag/libheif/issues/1176
2,312,883,259
1,176
[ "strukturag", "libheif" ]
Null on this line: console.log("Using libheif", libheif.heif_get_version()); > Uncaught TypeError: libheif.heif_get_version is not a function at window.onload (libheif/:314:46) But it works fine if I reload. execution order maybe? ``` window.onload = function() { hide("loading"); if (typeof libheif === "undefined") { alert("libheif could not be loaded, please check your browser console for details."); return; } console.log("Using libheif", libheif.heif_get_version()); var demo = new HeifDemo(libheif); show("form"); ```
null in js demo https://strukturag.github.io/libheif/
https://api.github.com/repos/strukturag/libheif/issues/1174/comments
0
2024-05-21T06:20:50Z
2024-05-21T06:26:36Z
https://github.com/strukturag/libheif/issues/1174
2,307,415,914
1,174
[ "strukturag", "libheif" ]
Hi all, I want to test the JPEG encode into HEIC, so I build libjpeg by myself although I'm not familiar to cmake and Windows programming. But when using the command: `cmake .. -DPNG_LIBRARY=e:\Downloads\libheif-master\lib\ -DPNG_PNG_INCLUDE_DIR=e:\Downloads\libheif-master\include\ -DZLIB_LIBRARY=e:\Downloads\libheif-master\lib\ -DZLIB_INCLUDE_DIR=e:\Downloads\libheif-master\include\ -DJPEG_LIBRARY=e:\Downloads\libheif-master\lib\ -DJPEG_INCLUDE_DIR=e:\Downloads\libheif-master\include\ -DLIBDE265_INCLUDE_DIR=e:\Downloads\libheif-master\include\ -DLIBDE265_LIBRARY=e:\Downloads\libheif-master\lib\ -DX265_INCLUDE_DIR=e:\Downloads\libheif-master\include\ -DX265_LIBRARY=e:\Downloads\libheif-master\lib\` It runs into error, the whole log as below, I don't know how to fix this. ```command line -- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.26100. -- The C compiler identification is MSVC 19.38.33133.0 -- The CXX compiler identification is MSVC 19.38.33133.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for unistd.h -- Looking for unistd.h - not found -- Performing Test has_potentially_evaluated_expression -- Performing Test has_potentially_evaluated_expression - Failed -- Found LIBDE265 -- Found LIBDE265: e:/Downloads/libheif-master/include -- Found X265 -- Found X265: e:/Downloads/libheif-master/include -- Looking for AOM_USAGE_GOOD_QUALITY -- Looking for AOM_USAGE_GOOD_QUALITY - not found CMake Warning at cmake/modules/LibFindMacros.cmake:267 (message): WARNING: MISSING PACKAGE We could not find development headers for AOM. Do you have the necessary dev package installed? This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of libheif. Relevant CMake configuration variables: AOM_INCLUDE_DIR=<not found> AOM_LIBRARY=<not found> You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary. Call Stack (most recent call first): cmake/modules/FindAOM.cmake:35 (libfind_process) CMakeLists.txt:140 (find_package) -- Could NOT find AOM (missing: AOM_INCLUDE_DIR AOM_LIBRARIES) === Summary of compiled codecs === libde265 HEVC decoder : + built-in FFMPEG HEVC decoder (HW acc) : - disabled x265 HEVC encoder : + built-in Kvazaar HEVC encoder : - disabled AOM AV1 decoder : - not found AOM AV1 encoder : - not found Dav1d AV1 decoder : - disabled SVT AV1 encoder : - disabled Rav1e AV1 encoder : - disabled JPEG decoder : - disabled JPEG encoder : - disabled OpenJPEG J2K decoder : - disabled OpenJPEG J2K encoder : - disabled CMake Warning at cmake/modules/LibFindMacros.cmake:267 (message): WARNING: MISSING PACKAGE We could not find development headers for LIBSHARPYUV. Do you have the necessary dev package installed? This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of libheif. Relevant CMake configuration variables: LIBSHARPYUV_INCLUDE_DIR=<not found> LIBSHARPYUV_LIBRARY=<not found> You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary. Call Stack (most recent call first): cmake/modules/Findlibsharpyuv.cmake:18 (libfind_process) CMakeLists.txt:207 (find_package) -- Could NOT find libsharpyuv (missing: LIBSHARPYUV_INCLUDE_DIR LIBSHARPYUV_LIBRARIES) libsharpyuv: disabled -- Looking for _LIBCPP_VERSION -- Looking for _LIBCPP_VERSION - not found -- Found JPEG: e:\Downloads\libheif-master\lib\ (found version "62") -- Performing Test HAVE_JPEG_WRITE_ICC_PROFILE CMake Error at E:/Downloads/libheif-master/build/CMakeFiles/CMakeScratch/TryCompile-h9ctai/CMakeLists.txt:32: Parse error. Function missing ending ")". Instead found unterminated string with text "e:\Downloads\libheif-master\lib\" ) ". CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/Internal/CheckSourceCompiles.cmake:101 (try_compile): Failed to configure test project build system. Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.29/Modules/CheckCXXSourceCompiles.cmake:52 (cmake_check_source_compiles) examples/CMakeLists.txt:69 (check_cxx_source_compiles) -- Configuring incomplete, errors occurred! ``` If I took off the `-DJPEG_LIBRARY=e:\Downloads\libheif-master\lib\ -DJPEG_INCLUDE_DIR=e:\Downloads\libheif-master\include\ ` from command, it can generate build file normally. All my libraries are in the `E:/Downloads/libheif-master/lib` and include files are in `E:/Downloads/libheif-master/include` Under the lib directory, I put files list as below: jpegtran-static.exe tjbench.exe tjunittest.exe cjpeg-static.exe djpeg-static.exe tjunittest-static.exe tjbench-static.exe djpeg.exe cjpeg.exe tjexample.exe jcstest.exe jpegtran.exe turbojpeg.dll turbojpeg.lib turbojpeg.exp turbojpeg-static.lib jpeg62.dll jpeg.lib jpeg.exp libjpeg_a.lib rdjpgcom.exe wrjpgcom.exe libpng.dll libpng.lib zlib.dll zlib.lib openjp2.dll openjp2.lib jpeg62.pdb turbojpeg.pdb libde265.pdb libde265.dll libx265.dll libx265.lib x265.lib x265.exe libx265.exp libde265.lib de265.exp libpng3.dll libpng12.dll zlib1.dll Is there something I missed? How can I do to this? Environment: Windows 11 24H2
When cmake with JPEG will failed: CMakeLists.txt:32: Parse error. Function missing ending ")".
https://api.github.com/repos/strukturag/libheif/issues/1170/comments
4
2024-05-20T12:54:48Z
2024-05-24T23:11:54Z
https://github.com/strukturag/libheif/issues/1170
2,305,940,530
1,170
[ "strukturag", "libheif" ]
Mentioning this here for lack of a better place (I can't seem to create a bug [here](https://bugs.launchpad.net/~strukturag)). Signing keys for strukturag PPAs are encrypted using rsa1024 ([link](https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=index&search=0xC6610628A707A7E5E391D27A9641080A705C2B92)), which is deprecated ([link](https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1461834)). This is preventing my organization from using these PPAs on FIPS compliant machines that have removed this cipher (specifically Ubuntu 22.04 pro w/ FIPS enabled - [link](https://ubuntu.com/security/certifications/docs/fips-enablement)). Can your signing keys please be re-encrypted with something else, like rsa4096? My organization is specifically using `libde265` and `libheif`, if that's helpful. Thanks in advance! Please let me know if there's a more appropriate place for this issue!
Encrypt ppa signing key with non-deprecated algorithm
https://api.github.com/repos/strukturag/libheif/issues/1169/comments
5
2024-05-09T19:39:46Z
2024-07-25T14:36:22Z
https://github.com/strukturag/libheif/issues/1169
2,288,332,101
1,169
[ "strukturag", "libheif" ]
When heif_context* doesn't read from a file, `HeifFile::m_input_stream` never initialized. Therefore, calling `heif_decode_image()` results in an unexpected Segmentation Fault. ```C // Read HEIF heif_context* ctx_read = heif_context_alloc(); heif_context_read_from_file(ctx_read, filename, nullptr); heif_image_handle* handle; heif_context_get_primary_image_handle(ctx_read, &handle); heif_image* img; heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr); // Write HEIF heif_encoder* encoder; heif_context* ctx_write = heif_context_alloc(); heif_context_get_encoder_for_format(ctx_write, heif_compression_HEVC, &encoder); // 1. Encode image heif_context_encode_image(ctx_write, img, encoder, nullptr, &handle); // 2. Get image back heif_decode_image(handle, &img, heif_colorspace_RGB, heif_chroma_interleaved_RGB, nullptr); // SEGFAULT ``` I would like this to work, or at least have `struct heif_error` catch it.
Encode then Decode Crash
https://api.github.com/repos/strukturag/libheif/issues/1168/comments
0
2024-05-07T16:16:42Z
2024-05-07T16:16:42Z
https://github.com/strukturag/libheif/issues/1168
2,283,755,913
1,168
[ "strukturag", "libheif" ]
Inside the `reset` method of the `decoder_context` the following is done: ``` dpb.clear(); nal_parser.remove_pending_input_data(); ``` Should this not also be done inside the destructor of `decoder_context`? We are getting an oss-fuzz error report about memory leaks of `NAL_unit` in the oss-fuzz tooling of @ImageMagick and it looks like it is happening because of this?
Should the destructor of decoder_context include more cleanups?
https://api.github.com/repos/strukturag/libheif/issues/1166/comments
1
2024-05-04T16:30:39Z
2024-06-11T18:49:02Z
https://github.com/strukturag/libheif/issues/1166
2,279,103,313
1,166
[ "strukturag", "libheif" ]
### Summary SEGV in `openjpeg_decode_image` ### Version - commit : 9ea417c17d91516291cfad193363f9915273a65d ### reproduce ``` # openjpeg commit: 51f097e6d5754ddae93e716276fe8176b44ec548 # step1: you need build this openjpeg with asan. # step2: build libheif with asan with it. CC="gcc -g -fsanitize=address" CXX="g++ -g -fsanitize=address" mkdir build && cd build cmake .. -DCMAKE_INSTALL_PREFIX=`realpath ./` -DWITH_UNCOMPRESSED_CODEC=ON -DENABLE_MULTITHREADING_SUPPORT=0 -DCMAKE_INSTALL_PREFIX=Debug -DWITH_OpenJPEG_ENCODER=1 -DWITH_OpenJPEG_DECODER=1 -DWITH_AOM_ENCODER=0 -DWITH_AOM_DECODER=0 make -j ``` ### ASAN ``` ================================================================= ==671410==ERROR: AddressSanitizer: SEGV on unknown address 0x7ff2d6432800 (pc 0x7ffff42e3c28 bp 0x7fffffffaa30 sp 0x7fffffff85f0 T0) ==671410==The signal is caused by a WRITE memory access. #0 0x7ffff42e3c27 in openjpeg_decode_image(void*, heif_image**) /home//supply/test/openjpeg-libheif/libheif/libheif/plugins/decoder_openjpeg.cc:383 #1 0x7ffff6fbf220 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const /home//supply/test/openjpeg-libheif/libheif/libheif/context.cc:1355 #2 0x7ffff6fbd52c in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const /home//supply/test/openjpeg-libheif/libheif/libheif/context.cc:1248 #3 0x7ffff6f80479 in heif_decode_image /home//supply/test/openjpeg-libheif/libheif/libheif/heif.cc:1042 #4 0x555555563960 in main /home//supply/test/openjpeg-libheif/libheif/examples/heif_info.cc:645 #5 0x7ffff6ab6082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #6 0x55555555d94d in _start (/home//supply/test/openjpeg-libheif/libheif/build_asan/Debug/bin/heif-info+0x994d) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home//supply/test/openj peg-libheif/libheif/libheif/plugins/decoder_openjpeg.cc:383 in openjpeg_decode_image(void*, heif_image**) ==671410==ABORTING ``` ### POC [poc-openjpeg.zip](https://github.com/strukturag/libheif/files/15156576/poc-openjpeg.zip)
SEGV in `openjpeg_decode_image`
https://api.github.com/repos/strukturag/libheif/issues/1165/comments
1
2024-04-30T01:21:38Z
2024-04-30T01:30:35Z
https://github.com/strukturag/libheif/issues/1165
2,270,308,542
1,165
[ "strukturag", "libheif" ]
Original issue with file example is here: https://github.com/bigcat88/pillow_heif/issues/234 Is there a way to get this information from an image and save the file so it contains it? ![image](https://github.com/strukturag/libheif/assets/13381981/8427056b-c9a8-4ce3-a175-f0ea16c839ef) I tried to find where it is stored using `heif-info -d` but totally get lost in number of different boxes those file contains.. I would be grateful for any help.
How can I retrieve additional metadata information from the Spatial HEIC
https://api.github.com/repos/strukturag/libheif/issues/1164/comments
23
2024-04-25T11:53:26Z
2024-06-17T10:09:19Z
https://github.com/strukturag/libheif/issues/1164
2,263,393,799
1,164
[ "strukturag", "libheif" ]
The `--depth` of avifenc enables it, can heif-enc add a similar option? Thanks.
Is it possible to add the option to convert 8bit input to 10bit encoding for heif-enc?
https://api.github.com/repos/strukturag/libheif/issues/1163/comments
17
2024-04-13T10:04:15Z
2024-04-14T00:41:54Z
https://github.com/strukturag/libheif/issues/1163
2,241,473,901
1,163
[ "strukturag", "libheif" ]
`Run the aom.cmd script in the third-party directory to download libaom and compile it.` This script requires cmake, ninja nasm to be installed, and even then it won't build the libaom successfully. In order to build it, use: `vcpkg install aom:x64-windows` command in vcpkg folder. Also make sure you do this before running `vcpkg install libheif` because the latter should locate the aom build before building itself.
Please update the Windows build instructions for libaom to use vcpkg system
https://api.github.com/repos/strukturag/libheif/issues/1162/comments
1
2024-04-12T15:42:26Z
2024-04-12T23:33:41Z
https://github.com/strukturag/libheif/issues/1162
2,240,411,407
1,162
[ "strukturag", "libheif" ]
Hello, I am using libheif to encode large images via x265 encoder. I am interested in testing the smallest CTU size (16). I receive the `Invalid Image size` error. For squared images with size HxH, this happens for H>1488. For convenience, we can reproduce the error using `heif-enc` on a 2048x2048 test image: ``` heif-enc -p x265:ctu=16 man4.jpg man4_ctu16.heic ``` ``` Could not encode HEIF/AVIF file: Encoder plugin generated an error: Invalid image size ``` It works fine with a smaller image, e.g. 1024x1024, or with higher `ctu`: ``` heif-enc -p x265:ctu=16 man1.jpg man1_ctu16.heic heif-enc -p x265:ctu=32 man4.jpg man4_ctu32.heic heif-enc -p x265:ctu=64 man4.jpg man4_ctu64.heic ``` It seems to be independent on the image content, at least with the samples I have tried. I am using libheif v1.17.6 and x265 v3.5. --- [test_images.zip](https://github.com/strukturag/libheif/files/14960588/test_images.zip)
Error in encoding big images with CTU size 16
https://api.github.com/repos/strukturag/libheif/issues/1161/comments
4
2024-04-12T15:27:15Z
2024-07-09T10:34:16Z
https://github.com/strukturag/libheif/issues/1161
2,240,386,152
1,161
[ "strukturag", "libheif" ]
I am learning libheif, I want to change the compatible brands,, pls help me.
How to change the compatible brands of heic image
https://api.github.com/repos/strukturag/libheif/issues/1160/comments
2
2024-04-02T07:52:25Z
2024-04-02T10:27:43Z
https://github.com/strukturag/libheif/issues/1160
2,219,816,674
1,160
[ "strukturag", "libheif" ]
PLS help: cmake --preset=release-noplugins .. -DCMAKE_INSTALL_PREFIX=/test/libheif/libheif-1.17.6/build/OUT make then error happened: Scanning dependencies of target heif-test [ 47%] Building CXX object examples/CMakeFiles/heif-test.dir/heif_test.cc.o [ 48%] Building CXX object examples/CMakeFiles/heif-test.dir/common.cc.o [ 50%] Linking CXX executable heif-test ../libheif/libheif.so.1.17.6: undefined reference to `get_encoder_plugin_mask()' collect2: error: ld returned 1 exit status examples/CMakeFiles/heif-test.dir/build.make:99: recipe for target 'examples/heif-test' failed make[2]: *** [examples/heif-test] Error 1 CMakeFiles/Makefile2:994: recipe for target 'examples/CMakeFiles/heif-test.dir/all' failed make[1]: *** [examples/CMakeFiles/heif-test.dir/all] Error 2 Makefile:162: recipe for target 'all' failed make: *** [all] Error 2
compile failed:undefined reference to `get_encoder_plugin_mask()'
https://api.github.com/repos/strukturag/libheif/issues/1159/comments
8
2024-04-02T06:38:04Z
2024-04-02T10:42:48Z
https://github.com/strukturag/libheif/issues/1159
2,219,679,613
1,159
[ "strukturag", "libheif" ]
### Description SEGV in `uncompressed_image_type_is_supported` ### Version ``` commit ID c98a3fae1ac63cc6052e40b26733396a8598542d ``` ``` ➜ libheif git:(master) ✗ ./build_asan/examples/heif-info -v 1.17.6 libheif: 1.17.6 plugin path: ./libheif/build_asan/lib/libheif ``` ### Replay ``` git clone https://github.com/strukturag/libheif.git cd libheif mkdir build_asan cd build_asan cmake .. -DWITH_UNCOMPRESSED_CODEC=ON -DENABLE_MULTITHREADING_SUPPORT=0 -DCMAKE_INSTALL_PREFIX=Debug -DBUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX=`realpath .` make -j ./examples/heif-convert poc test.png ``` ### ASAN ``` ➜ libheif git:(main) ✗ ./build_asan/examples/heif-info ./poc MIME type: image/heif main brand: mif1 compatible brands: mif1, heif image: 0x10 (id=1), primary colorspace: YCbCr, unknown bit depth: -1 color profile: no alpha channel: no depth channel: no metadata: none transformations: none region annotations: none properties: ASAN:DEADLYSIGNAL ================================================================= ==1689276==ERROR: AddressSanitizer: SEGV on unknown address 0x60e00027fe08 (pc 0x7ffff70fe09a bp 0x7fffffff9d60 sp 0x7fffffff8820 T0) ==1689276==The signal is caused by a READ memory access. #0 0x7ffff70fe099 in uncompressed_image_type_is_supported libheif/libheif/uncompressed_image.cc:367 #1 0x7ffff7101fda in UncompressedImageCodec::decode_uncompressed_image(std::shared_ptr<HeifFile const> const&, unsigned int, std::shared_ptr<HeifPixelImage>&, unsigned int, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&) libheif/libheif/uncompressed_image.cc:672 #2 0x7ffff6fc0598 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const libheif/libheif/context.cc:1452 #3 0x7ffff6fbd53c in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const libheif/libheif/context.cc:1248 #4 0x7ffff6f80489 in heif_decode_image libheif/libheif/heif.cc:1042 #5 0x555555563960 in main libheif/examples/heif_info.cc:645 #6 0x7ffff6ab6082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #7 0x55555555d94d in _start (libheif/build_asan/examples/heif-info+0x994d) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV libheif/libheif/uncompressed_image.cc:367 in uncompressed_image_type_is_supported ==1689276==ABORTING ``` ### PoC [poc](https://github.com/fdu-sec/poc/raw/main/libheif/poc6) ### Environment ``` ➜ ~ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal ➜ ~ gcc --version gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ```
SEGV in `uncompressed_image_type_is_supported`
https://api.github.com/repos/strukturag/libheif/issues/1157/comments
3
2024-03-29T11:02:23Z
2024-07-09T10:34:49Z
https://github.com/strukturag/libheif/issues/1157
2,215,130,072
1,157
[ "strukturag", "libheif" ]
There is a flag on item property references if it is "essential" that it be understood. Right now, it looks like we're ignoring that, and potentially trying to handle images that require functionality we don't provide. I hit this experimenting with the ISO 23001-17 Amd 2 CDAM generically compressed image support, where there are some extra properties to say "zlib inflate the data before decoding".
Essential item properties should be checked
https://api.github.com/repos/strukturag/libheif/issues/1153/comments
1
2024-03-20T10:00:59Z
2024-06-25T19:33:04Z
https://github.com/strukturag/libheif/issues/1153
2,197,128,255
1,153
[ "strukturag", "libheif" ]
How to compile libheif with openjpeg ? I use `PKG_CONFIG_PATH` but failed, I do not want install this library: ``` -- The imported target "opj_decompress" references the file "/usr/bin/opj_decompress" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained "/usr/lib/x86_64-linux-gnu/openjpeg-2.1/OpenJPEGTargets.cmake" but not all the files it references. ```
How to Compile libheif with openjpeg ?
https://api.github.com/repos/strukturag/libheif/issues/1152/comments
4
2024-03-20T08:49:12Z
2024-03-20T12:31:13Z
https://github.com/strukturag/libheif/issues/1152
2,196,973,921
1,152
[ "strukturag", "libheif" ]
Not sure why but I can't get it to buildjs using the emscripten script from source or from 1.17.6 per the readme. ``` [ 75%] Building CXX object libheif/CMakeFiles/heif.dir/plugins/encoder_mask.cc.o cd /home/user/libheif/buildjs/libheif && /usr/bin/em++ -DHAVE_LIBDE265=1 -DHAVE_VISIBILITY -DLIBHEIF_EXPORTS @CMakeFiles/heif.dir/includes_CXX.rsp -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=tautological-compare -Wno-error=tautological-constant-out-of-range-compare -std=c++11 -MD -MT libheif/CMakeFiles/heif.dir/plugins/encoder_mask.cc.o -MF CMakeFiles/heif.dir/plugins/encoder_mask.cc.o.d -o CMakeFiles/heif.dir/plugins/encoder_mask.cc.o -c /home/user/libheif/libheif/plugins/encoder_mask.cc /home/user/libheif/libheif/plugins/decoder_libde265.cc:30:10: fatal error: 'libde265/de265.h' file not found #include <libde265/de265.h> ^~~~~~~~~~~~~~~~~~ 1 error generated. em++: error: '/usr/bin/clang++-13 -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=5 -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D_LIBCPP_ABI_VERSION=2 -fno-threadsafe-statics -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/usr/share/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_LIBDE265=1 -DHAVE_VISIBILITY -DLIBHEIF_EXPORTS -I/home/user/libheif/buildjs -I/home/user/libheif -I/home/user/libheif/include/libheif -I/home/user/libheif/include -I/home/user/libheif/libde265-1.0.12 -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=tautological-compare -Wno-error=tautological-constant-out-of-range-compare -std=c++11 -MD -MT libheif/CMakeFiles/heif.dir/plugins/decoder_libde265.cc.o -MF CMakeFiles/heif.dir/plugins/decoder_libde265.cc.o.d -c /home/user/libheif/libheif/plugins/decoder_libde265.cc -o CMakeFiles/heif.dir/plugins/decoder_libde265.cc.o' failed (returned 1) make[2]: *** [libheif/CMakeFiles/heif.dir/build.make:542: libheif/CMakeFiles/heif.dir/plugins/decoder_libde265.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/home/user/libheif/buildjs' make[1]: *** [CMakeFiles/Makefile2:989: libheif/CMakeFiles/heif.dir/all] Error 2 make[1]: Leaving directory '/home/user/libheif/buildjs' make: *** [Makefile:166: all] Error 2 emmake: error: 'make -j8' failed (returned 2) ```
Build error file not found
https://api.github.com/repos/strukturag/libheif/issues/1151/comments
2
2024-03-20T02:38:12Z
2024-03-24T03:11:35Z
https://github.com/strukturag/libheif/issues/1151
2,196,560,911
1,151
[ "strukturag", "libheif" ]
Using the command `heif-convert` with the quality option `-q [0...100]` only has an effect when the output type is jpg. The option has no effect for `.png` and `.y4m`. It would be cool if that could be reflected in the man pages.
Add info to Man page; Quality; png
https://api.github.com/repos/strukturag/libheif/issues/1150/comments
1
2024-03-19T21:47:46Z
2024-08-10T08:58:41Z
https://github.com/strukturag/libheif/issues/1150
2,196,084,370
1,150
[ "strukturag", "libheif" ]
Filing issue to document email thread with @farindk. ImageMagick is rejecting some prototype files that I have been creating with the following error: identify: Invalid input: Unspecified: Too many auxiliary image references (2.0) `file_with_shared_alpha.heic' @ error/heic.c/IsHEIFSuccess/142. The error is coming from libheif rather than ImageMagick itself. The file in question has two main images (in an 'altr' group) that share an alpha auxiliary image. To me this should be perfectly valid and makes a lot of sense once you start creating files containing 'altr' groups, but I can see why this would be unexpected for simpler files. The conclusion from the thread is that there is nothing in the spec that explicitly forbids sharing the same auxiliary image between multiple main images and that the restriction in libheif should probably be relaxed. ISOBMFF says that all irefs of a specific type from a source item should be collected into a single ItemReferenceBox, so having multiple irefs is not really an option. [file_with_shared_alpha.heic.zip](https://github.com/strukturag/libheif/files/14641161/file_with_shared_alpha.heic.zip)
Files with shared auxiliary images fail to parse
https://api.github.com/repos/strukturag/libheif/issues/1147/comments
8
2024-03-18T18:56:43Z
2024-06-26T17:28:54Z
https://github.com/strukturag/libheif/issues/1147
2,193,024,118
1,147
[ "strukturag", "libheif" ]
Hi! I've had this setup before for heic decoding on Android: CMakeLists.txt ``` if (POLICY CMP0079) cmake_policy(SET CMP0079 NEW) endif () FetchContent_Declare(libheif GIT_REPOSITORY https://github.com/strukturag/libheif GIT_TAG v1.12.0 PATCH_COMMAND echo "" > tests/CMakeLists.txt BINARY_DIR build SUBBUILD_DIR subbuild ) include(libde265.cmake) option(BUILD_SHARED_LIBS "" OFF) option(WITH_EXAMPLES "" OFF) option(WITH_DAV1D "" OFF) option(WITH_LIBDE265 "" OFF) option(WITH_X265 "" OFF) option(WITH_AOM "" OFF) option(WITH_RAV1E "" OFF) FetchContent_MakeAvailable(libheif) target_include_directories(heifdecoder PRIVATE ${libheif_BINARY_DIR} ${libheif_SOURCE_DIR}) target_link_libraries(heifdecoder heif) ``` libde265.cmake ``` FetchContent_Declare(libde265 GIT_REPOSITORY https://github.com/strukturag/libde265.git GIT_TAG v1.0.8 BINARY_DIR libde265-build SUBBUILD_DIR libde265-subbuild ) option(BUILD_SHARED_LIBS "" OFF) option(ENABLE_SDL "" OFF) if (${ANDROID} AND NOT ${ANDROID_ABI} STREQUAL "x86" AND NOT ${ANDROID_ABI} STREQUAL "x86_64") option(DISABLE_SSE "" ON) endif() FetchContent_MakeAvailable(libde265) set(LIBDE265_FOUND 1) set(LIBDE265_LIBRARIES libde265) set(LIBDE265_INCLUDE_DIR "${libde265_SOURCE_DIR}" "${libde265_BINARY_DIR}" ) ``` Main CMakeLists.txt ``` cmake_minimum_required(VERSION 3.4.1) set(CMAKE_CXX_STANDARD 17) set(Root_DIR ${CMAKE_SOURCE_DIR}/../../../..) project(heifdecoder C CXX ASM) include(FetchContent) add_library(heifdecoder SHARED HeifDecoder.cpp ) get_filename_component(deps "../_deps" REALPATH BASE_DIR "${CMAKE_BINARY_DIR}") set(FETCHCONTENT_BASE_DIR ${deps}) add_subdirectory(libheif) add_definitions(-DHAVE_LIBHEIF) target_link_libraries(heifdecoder android jnigraphics log) ``` This worked perfectly until I tried to update the libraries to the latest versions (1.17.6 and 1.0.15) Now I get this error: > Failed to decode image: Unsupported feature: Unsupported codec As I understand libheif can't find the libde265 plugin anymore, but not sure why this happens. Did something change in the configuration with library updates? Thanks
Failed to decode image: Unsupported feature: Unsupported codec
https://api.github.com/repos/strukturag/libheif/issues/1145/comments
8
2024-03-12T13:49:39Z
2024-03-28T18:17:16Z
https://github.com/strukturag/libheif/issues/1145
2,181,674,068
1,145
[ "strukturag", "libheif" ]
I downloaded photos from my google drive. On the google-drive I can preview my file. When I downloaded it, I can not view. Some of the other files that I downloaded are 1.7meg or smaller and they can be viewed. I am using Ubuntu V18.04, your library, correctly installed I think. image_viewer is my rendering tool. I tried to attach files, but the best I can do is give you the following link as HEIC format is not allowed for upload on git hub the best I can do is give you two links https://drive.google.com/file/d/1GI4HRvNrusEcYaCeo_eJRY2Utv3ft2xR/view?usp=sharing https://drive.google.com/file/d/1qBpWbHHSn5dZJ9b0aJlsK99yLfHchErh/view?usp=sharing the first I can not view the second I can when downloaded. One last item under priorities, when downloaded the first file has only size while the second is treated as if it is a photo. Thank you ahead of time for the assist
HEIC rendering file larger than 1.7meg on ubuntu 18.04 fails
https://api.github.com/repos/strukturag/libheif/issues/1144/comments
2
2024-03-11T15:24:10Z
2024-03-12T08:46:46Z
https://github.com/strukturag/libheif/issues/1144
2,179,424,529
1,144
[ "strukturag", "libheif" ]
The kvazaar plugin has some memory leaks. In particular, the data chunks returned from kvazaar as encoded image are not freed in all cases. See See https://github.com/strukturag/libheif/pull/1141 for a possible fix.
Memory leaks when encoding with kvazaar
https://api.github.com/repos/strukturag/libheif/issues/1143/comments
1
2024-03-11T08:22:32Z
2024-06-27T13:57:32Z
https://github.com/strukturag/libheif/issues/1143
2,178,514,779
1,143
[ "strukturag", "libheif" ]
null
whether heif supports images with alpha, such as webp?
https://api.github.com/repos/strukturag/libheif/issues/1142/comments
10
2024-03-11T07:12:10Z
2024-03-12T08:48:04Z
https://github.com/strukturag/libheif/issues/1142
2,178,387,602
1,142
[ "strukturag", "libheif" ]
### Description Stack-buffer-overwrite in function heif_image_get_decoding_warnings ### Version ``` commit ID 33e00a4ec54e6fffca3febe3054017b1b81a0c49 ``` ``` $ ./examples/heif-convert -v 1.17.6 libheif: 1.17.6 plugin path: /usr/local/lib/libheif ``` ``` $ ./examples/heif-convert --list-decoders HEIC decoders: - libde265 = libde265 HEVC decoder, version 1.0.4 AVIF decoders: - aom = AOMedia Project AV1 Decoder v1.0.0 JPEG decoders: JPEG 2000 decoders: uncompressed: no ``` ### Replay ``` git clone https://github.com/strukturag/libheif.git cd libheif CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake . make -j ./examples/heif-convert poc test.png ``` ### ASAN ``` File contains 1 image ================================================================= ==4098626==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffce00 at pc 0x7ffff6f9a7a3 bp 0x7fffffffc630 sp 0x7fffffffc620 WRITE of size 16 at 0x7fffffffce00 thread T0 #0 0x7ffff6f9a7a2 in heif_image_get_decoding_warnings (/libheif/libheif/libheif.so.1+0xf97a2) #1 0x555555564b82 in main (/libheif/examples/heif-convert+0x10b82) #2 0x7ffff6a17082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #3 0x55555555fadd in _start (/libheif/examples/heif-convert+0xbadd) Address 0x7fffffffce00 is located in stack of thread T0 at offset 1712 in frame #0 0x5555555627df in main (/libheif/examples/heif-convert+0xe7df) This frame has 62 object(s): [32, 33) 'initializer' [96, 97) '<unknown>' [160, 161) '<unknown>' [224, 225) '<unknown>' [288, 289) '<unknown>' [352, 353) '<unknown>' [416, 417) '<unknown>' [480, 481) '<unknown>' [544, 545) '<unknown>' [608, 609) '<unknown>' [672, 673) '<unknown>' [736, 737) '<unknown>' [800, 801) '<unknown>' [864, 868) 'option_index' [928, 932) 'depth_id' [992, 1000) 'encoder' [1056, 1064) 'cr' [1120, 1128) 'handle' [1184, 1192) 'image' [1248, 1256) 'depth_handle' [1312, 1320) 'depth_image' [1376, 1384) '__for_begin' [1440, 1448) '__for_end' [1504, 1512) 'aux_handle' [1568, 1576) 'aux_image' [1632, 1640) 'auxTypeC' [1696, 1712) 'err' <== Memory access at offset 1712 overflows this variable [1760, 1784) 'image_IDs' [1824, 1848) 'auxIDs' [1888, 1912) 'ids' [1952, 1976) 'xmp' [2016, 2040) 'exif' [2080, 2112) '<unknown>' [2144, 2176) 'input_filename' [2208, 2240) 'output_filename_stem' [2272, 2304) 'output_filename_suffix' [2336, 2368) 'input_stem' [2400, 2432) '<unknown>' [2464, 2496) '<unknown>' [2528, 2560) '<unknown>' [2592, 2624) 'suffix_lowercase' [2656, 2688) 'filename' [2720, 2752) 'numbered_output_filename_stem' [2784, 2816) '<unknown>' [2848, 2880) '<unknown>' [2912, 2944) '<unknown>' [2976, 3008) '<unknown>' [3040, 3072) 'auxType' [3104, 3136) '<unknown>' [3168, 3200) '<unknown>' [3232, 3264) 'auxFilename' [3296, 3328) 'itemtype' [3360, 3392) 'contenttype' [3424, 3456) 'xmp_filename' [3488, 3520) 'exif_filename' [3552, 3928) 's' [3968, 4344) 's' [4384, 4760) 's' [4800, 5312) 'ostr' [5344, 5856) 'ostr' [5888, 6408) 'istr' [6464, 6476) 'magic' HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow (/libheif/libheif/libheif.so.1+0xf97a2) in heif_image_get_decoding_warnings Shadow bytes around the buggy address: 0x10007fff7970: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 0x10007fff7980: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 0x10007fff7990: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 0x10007fff79a0: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 f2 0x10007fff79b0: f2 f2 f2 f2 f2 f2 00 f2 f2 f2 f2 f2 f2 f2 00 00 =>0x10007fff79c0:[f2]f2 f2 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 0x10007fff79d0: 00 f2 f2 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 0x10007fff79e0: 00 f2 f2 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2 00 00 0x10007fff79f0: 00 00 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 0x10007fff7a00: 00 00 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 0x10007fff7a10: 00 00 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==4098626==ABORTING ``` ### PoC https://github.com/fdu-sec/poc/blob/main/libheif/stack-buffer-overflow.heif ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ```
Stack-buffer-overwrite in function heif_image_get_decoding_warnings
https://api.github.com/repos/strukturag/libheif/issues/1140/comments
0
2024-03-08T03:14:14Z
2024-03-08T03:14:14Z
https://github.com/strukturag/libheif/issues/1140
2,175,195,681
1,140
[ "strukturag", "libheif" ]
Hello, How can I set the `ctuSize` when using `heif_compression_HEVC` as `heif::Encoder`? Is the parameter already exposed to libheif users? Or does the codebase require changes? Thank you!
ctuSize in heif_compression_HEVC encoder
https://api.github.com/repos/strukturag/libheif/issues/1138/comments
3
2024-03-05T09:02:02Z
2024-03-05T11:13:35Z
https://github.com/strukturag/libheif/issues/1138
2,168,664,175
1,138
[ "strukturag", "libheif" ]
I'm trying to compile the libheif library from source on my fedora 39 machine. On both the latest tagged release and the master branch I run into this error: I'm not sure what I'm doing wrong or how to fix it? ``` [ 87%] Building CXX object libheif/plugins/CMakeFiles/heif-j2kdec.dir/decoder_openjpeg.cc.o /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc: In function ‘const char* openjpeg_plugin_name()’: /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:46:3: error: ‘snprintf’ was not declared in this scope 46 | snprintf(plugin_name, MAX_PLUGIN_NAME_LENGTH, "OpenJPEG %s", opj_version()); | ^~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:30:1: note: ‘snprintf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’? 29 | #include <cassert> +++ |+#include <cstdio> 30 | /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc: At global scope: /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:117:8: error: ‘OPJ_SIZE_T’ does not name a type 117 | static OPJ_SIZE_T opj_memory_stream_read(void* p_buffer, OPJ_SIZE_T p_nb_bytes, void* p_user_data) | ^~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:149:8: error: ‘OPJ_SIZE_T’ does not name a type 149 | static OPJ_SIZE_T opj_memory_stream_write(void* p_buffer, OPJ_SIZE_T p_nb_bytes, void* p_user_data) | ^~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:158:8: error: ‘OPJ_OFF_T’ does not name a type 158 | static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T p_nb_bytes, void* p_user_data) | ^~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:191:8: error: ‘OPJ_BOOL’ does not name a type 191 | static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T p_nb_bytes, void* p_user_data) | ^~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:220:1: error: ‘opj_stream_t’ does not name a type 220 | opj_stream_t* opj_stream_create_default_memory_stream(openjpeg_decoder* p_decoder, OPJ_BOOL p_is_read_stream) | ^~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc: In function ‘heif_error openjpeg_decode_image(void*, heif_image**)’: /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:256:3: error: ‘OPJ_BOOL’ was not declared in this scope 256 | OPJ_BOOL success; | ^~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:258:3: error: ‘opj_codec_t’ was not declared in this scope; did you mean ‘opj_poc_t’? 258 | opj_codec_t* l_codec; | ^~~~~~~~~~~ | opj_poc_t /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:258:16: error: ‘l_codec’ was not declared in this scope 258 | opj_codec_t* l_codec; | ^~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:262:35: error: ‘OPJ_CODEC_J2K’ was not declared in this scope; did you mean ‘CODEC_J2K’? 262 | l_codec = opj_create_decompress(OPJ_CODEC_J2K); | ^~~~~~~~~~~~~ | CODEC_J2K /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:263:3: error: ‘success’ was not declared in this scope 263 | success = opj_setup_decoder(l_codec, &decompression_parameters); | ^~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:272:11: error: expected ‘;’ before ‘is_read_stream’ 272 | OPJ_BOOL is_read_stream = true; | ^~~~~~~~~~~~~~~ | ; /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:273:3: error: ‘opj_stream_t’ was not declared in this scope 273 | opj_stream_t* stream = opj_stream_create_default_memory_stream(decoder, is_read_stream); | ^~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:273:17: error: ‘stream’ was not declared in this scope; did you mean ‘strcat’? 273 | opj_stream_t* stream = opj_stream_create_default_memory_stream(decoder, is_read_stream); | ^~~~~~ | strcat /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:273:75: error: ‘is_read_stream’ was not declared in this scope 273 | opj_stream_t* stream = opj_stream_create_default_memory_stream(decoder, is_read_stream); | ^~~~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:273:26: error: ‘opj_stream_create_default_memory_stream’ was not declared in this scope 273 | opj_stream_t* stream = opj_stream_create_default_memory_stream(decoder, is_read_stream); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:278:13: error: ‘opj_read_header’ was not declared in this scope 278 | success = opj_read_header(stream, l_codec, &image); | ^~~~~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:288:35: error: ‘OPJ_CLRSPC_UNSPECIFIED’ was not declared in this scope; did you mean ‘CLRSPC_UNSPECIFIED’? 288 | else if ((image->color_space != OPJ_CLRSPC_UNSPECIFIED) && (image->color_space != OPJ_CLRSPC_SRGB)) { | ^~~~~~~~~~~~~~~~~~~~~~ | CLRSPC_UNSPECIFIED /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:288:85: error: ‘OPJ_CLRSPC_SRGB’ was not declared in this scope; did you mean ‘CLRSPC_SRGB’? 288 | else if ((image->color_space != OPJ_CLRSPC_UNSPECIFIED) && (image->color_space != OPJ_CLRSPC_SRGB)) { | ^~~~~~~~~~~~~~~ | CLRSPC_SRGB /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:306:13: error: ‘opj_end_decompress’ was not declared in this scope; did you mean ‘opj_create_decompress’? 306 | success = opj_end_decompress(l_codec, stream); | ^~~~~~~~~~~~~~~~~~ | opj_create_decompress /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:314:3: error: ‘opj_stream_destroy’ was not declared in this scope; did you mean ‘opj_image_destroy’? 314 | opj_stream_destroy(stream); | ^~~~~~~~~~~~~~~~~~ | opj_image_destroy /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:359:24: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare] 359 | for (size_t c = 0; c < image->numcomps; c++) { | ~~^~~~~~~~~~~~~~~~~ /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc: At global scope: /home/username/tmp/libheif-1.17.6/libheif/plugins/decoder_openjpeg.cc:212:13: error: ‘void opj_memory_stream_do_nothing(void*)’ defined but not used [-Werror=unused-function] 212 | static void opj_memory_stream_do_nothing(void* p_user_data) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[2]: *** [libheif/plugins/CMakeFiles/heif-j2kdec.dir/build.make:76: libheif/plugins/CMakeFiles/heif-j2kdec.dir/decoder_openjpeg.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:563: libheif/plugins/CMakeFiles/heif-j2kdec.dir/all] Error 2 make: *** [Makefile:156: all] Error 2 ```
Cannot compile OpenJPEG decoder plugin
https://api.github.com/repos/strukturag/libheif/issues/1134/comments
8
2024-02-28T10:18:30Z
2024-06-11T09:47:15Z
https://github.com/strukturag/libheif/issues/1134
2,158,602,933
1,134
[ "strukturag", "libheif" ]
Hi! I faced with some issues after update libheif in a project from 1.12.0 to 1.17.6. I'm get an errors for some files that were successfully processed in version 1.12.0. It happens when I call heif_context_read_from_reader(). For sample_1.heic it is error code 2: "Invalid input: Unspecified: 'iref' has double references" For sample_2.heic it is error code 6: "Memory allocation error: Security limit exceeded: Maximum number of child boxes 20000 exceeded." At the same time for 1.12.0 version I get 0 error code, get the page count after heif_context_get_number_of_top_level_images() calling, image handle after heif_context_get_image_handle() etc. without any problem. Could you tell pls, is it expected behavior in this case? It is strange for me because I successfully processed these files with previous version before. Thank you. Samples download link: https://drive.google.com/file/d/1F8UqW57cFx06CF4p2ZU81mjY8f2YKmTt/view?usp=sharing
Some files processing errors after update to 1.17.6
https://api.github.com/repos/strukturag/libheif/issues/1133/comments
7
2024-02-27T10:26:51Z
2024-04-10T22:44:02Z
https://github.com/strukturag/libheif/issues/1133
2,156,227,665
1,133
[ "strukturag", "libheif" ]
[Here](https://github.com/link-u/avif-sample-images/blob/master/kimono.rotate90.avif) is an image for which libheif 1.17 reports wrong dimensions for the primary image. It has width 722 and height 1024 after the correct rotation is applied, but libheif outputs 1024x722. ``` $ ./heif-info kimono.rotate90.avif MIME type: image/avif main brand: avif compatible brands: avif, mif1, miaf, MA1B image: 1024x722 (id=1), primary colorspace: YCbCr, 4:4:4 bit depth: 8 color profile: no alpha channel: no depth channel: no metadata: none transformations: angle (ccw): 270 [...] ``` I believe the problem is [here]( https://github.com/strukturag/libheif/blob/33e00a4ec54e6fffca3febe3054017b1b81a0c49/libheif/context.cc#L614): For some reason the `irot` box appears before the `ispe` box, and thus line 626, which is supposed to flip the dimensions, is never called.
Wrong image dimensions when irot is set
https://api.github.com/repos/strukturag/libheif/issues/1131/comments
6
2024-02-22T22:32:59Z
2024-06-27T14:06:01Z
https://github.com/strukturag/libheif/issues/1131
2,150,055,320
1,131
[ "strukturag", "libheif" ]
Running [build-android-libs.sh](https://github.com/strukturag/libheif/blob/master/scripts/build-android-libs.sh) fails with the following error `[ 79%] Linking CXX executable encode ld: error: undefined symbol: __android_log_write referenced by catch.hpp:10374 (/home/vboxuser/GitHub/project/externals/libheif/tests/catch.hpp:10374) CMakeFiles/encode.dir/main.cc.o:(Catch::Detail::(anonymous namespace)::StreamBufImpl<Catch::Detail::(anonymous namespace)::OutputDebugWriter, 256u>::sync()) referenced by catch.hpp:10374 (/home/vboxuser/GitHub/project/externals/libheif/tests/catch.hpp:10374) CMakeFiles/encode.dir/main.cc.o:(Catch::Detail::(anonymous namespace)::StreamBufImpl<Catch::Detail::(anonymous namespace)::OutputDebugWriter, 256u>::overflow(int)) clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [tests/CMakeFiles/encode.dir/build.make:146: tests/encode] Error 1 make[1]: *** [CMakeFiles/Makefile2:937: tests/CMakeFiles/encode.dir/all] Error 2 make: *** [Makefile:166: all] Error 2` This can be fixed with the cmake argument: `-DCMAKE_CXX_STANDARD_LIBRARIES="-llog"` NDK version: 25.2.9519653 Min API level: 24
Linker fails to find Android logger
https://api.github.com/repos/strukturag/libheif/issues/1126/comments
1
2024-02-10T21:21:58Z
2024-06-11T08:00:10Z
https://github.com/strukturag/libheif/issues/1126
2,128,718,057
1,126
[ "strukturag", "libheif" ]
"Error" is a very big claim in the "::" namespace, and it conflicts at link time with other libraries, some of which (eg Helix's Perforce API) are effectively un-recompilable. While it's not fair that libheif should be the one to fix this particular conflict, no library should be polluting the :: namespace like this anyway. I have had to remove heif support from my static ImageMagick build (which likely means even more work later) because of this.
Please put the ::Error class in a real namespace or rename it something like "::HeifError"
https://api.github.com/repos/strukturag/libheif/issues/1125/comments
12
2024-02-06T01:37:18Z
2024-02-06T20:44:45Z
https://github.com/strukturag/libheif/issues/1125
2,119,768,623
1,125
[ "strukturag", "libheif" ]
Why is it important? At the moment there is no way to turn this off, which may result in unnecessary libraries being loaded, and they will by default have a higher priority than the software that comes with the libheif, what will cause a very tricker debug why for specific cases your code work not as expected. Also from security reason this is not a good way to load a libraries from path that you cannot control. This can be implemented s as a flag in heif_init or as a compile-time flag. From my pow, the environment variable “LIBHEIF_PLUGIN_PATH” is ok; it is not necessary to cancel loading from it, because if you really need, you can just remove it or make empty before calling heif_init, so at least here control for what can be loaded is present. ----- Also, in order not to create a small question(perhaps the answer should be put in the readme), what will happen in such a situation: 1. Libheif loads version 1.0.0 of the XXX encoder during `heif_init` (for example such encoder is in LIBHEIF_PLUGIN_PATH) 2. After this, a call occurs to `heif_load_plugin` on version 1.1.0 of the XXX encoder that are in a separate custom folder What the expected as a result in this situation?
Provide a way to disable automatic loading plugins from LIBHEIF_PLUGIN_DIRECTORY
https://api.github.com/repos/strukturag/libheif/issues/1122/comments
0
2024-02-02T09:26:36Z
2024-02-02T09:26:36Z
https://github.com/strukturag/libheif/issues/1122
2,114,479,097
1,122
[ "strukturag", "libheif" ]
When there are several encoders / decoders for the same format, we might want to prefer hardware codecs over software, but they may have limitations on their maximum supported sizes, bpp, ... (see comment in: https://github.com/strukturag/libheif/pull/1072/#issuecomment-1869384941). We need to extend the plugin API to allow querying whether a format can be processed. Moreover the user must be enabled to specify a list of codecs to use, ordered by priority. Those will be queried after each other until a plugin is found that can process the data.
Provide a way to specify list of codecs in order of priority
https://api.github.com/repos/strukturag/libheif/issues/1111/comments
0
2024-01-16T11:17:42Z
2024-01-16T11:17:42Z
https://github.com/strukturag/libheif/issues/1111
2,083,688,526
1,111
[ "strukturag", "libheif" ]
Probably not really an issue when using software encoders, but might be more complicated if there is hardware involved. ``` $ valgrind --leak-check=full ./examples/heif-enc --params --encoder x265 /usr/share/wallpapers/Dance_of_the_Spirits/contents/images/2560x1600.jpg -o out.heif ==17583== Memcheck, a memory error detector ==17583== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==17583== Using Valgrind-3.21.0 and LibVEX; rerun with -h for copyright info ==17583== Command: ./examples/heif-enc --params --encoder x265 /usr/share/wallpapers/Dance_of_the_Spirits/contents/images/2560x1600.jpg -o out.heif ==17583== Parameters for encoder `x265 HEVC encoder (3.5+1-f0c1022b6)`: quality, default=50, [0;100] lossless, default=false preset, default=slow, { ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow,placebo } tune, default=ssim, { psnr,ssim,grain,fastdecode } tu-intra-depth, default=2, [1;4] complexity, [0;100] chroma, default=420, { 420,422,444 } ==17583== ==17583== HEAP SUMMARY: ==17583== in use at exit: 464 bytes in 3 blocks ==17583== total heap usage: 207 allocs, 204 frees, 174,935 bytes allocated ==17583== ==17583== 464 (16 direct, 448 indirect) bytes in 1 blocks are definitely lost in loss record 3 of 3 ==17583== at 0x4845FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==17583== by 0x48F0934: heif_context_get_encoder (heif.cc:2133) ==17583== by 0x111603: main (heif_enc.cc:716) ==17583== ==17583== LEAK SUMMARY: ==17583== definitely lost: 16 bytes in 1 blocks ==17583== indirectly lost: 448 bytes in 2 blocks ==17583== possibly lost: 0 bytes in 0 blocks ==17583== still reachable: 0 bytes in 0 blocks ==17583== suppressed: 0 bytes in 0 blocks ==17583== ==17583== For lists of detected and suppressed errors, rerun with: -s ==17583== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ```
heif-enc leaks encoder when using --params
https://api.github.com/repos/strukturag/libheif/issues/1102/comments
1
2024-01-11T01:17:58Z
2024-06-11T18:57:04Z
https://github.com/strukturag/libheif/issues/1102
2,075,521,615
1,102
[ "strukturag", "libheif" ]
Something like: ``` ./examples/heif-enc --params --encoder x265 ``` should produce the list of parameters, but it produces a usage statement. Instead, it needs the input file to get past the command line checks, even though it isn't using that file (and makes no output).
heif-enc requires input file to show parameters
https://api.github.com/repos/strukturag/libheif/issues/1101/comments
0
2024-01-11T01:12:13Z
2024-06-11T13:23:20Z
https://github.com/strukturag/libheif/issues/1101
2,075,512,861
1,101
[ "strukturag", "libheif" ]
This is a placeholder, a bit more investigation required to fully scope the problem. It looks like heif-enc actually shows the current value. https://github.com/strukturag/libheif/blob/d9daff2e6e54cc21c3f01a9312af73f2cbd4c8f5/examples/heif_enc.cc#L227-L233 and https://github.com/strukturag/libheif/blob/d9daff2e6e54cc21c3f01a9312af73f2cbd4c8f5/libheif/heif.cc#L2297-L2302 It looks like at least x265 avoids showing default for one case, even though it does have a default: https://github.com/strukturag/libheif/blob/d9daff2e6e54cc21c3f01a9312af73f2cbd4c8f5/libheif/plugins/encoder_x265.cc#L267
heif-enc --params does not show integer defaults
https://api.github.com/repos/strukturag/libheif/issues/1100/comments
0
2024-01-10T08:56:42Z
2024-01-10T08:56:42Z
https://github.com/strukturag/libheif/issues/1100
2,073,892,752
1,100
[ "strukturag", "libheif" ]
Building libheif with brew with modified formula: ` -DWITH_FFMPEG_DECODER=ON -DWITH_FFMPEG_DECODER_PLUGIN=ON ` ``` [100%] Linking CXX shared module libheif-ffmpegdec.so cd /tmp/libheif-20240107-59963-jb96bl/libheif-1.17.6/build/libheif/plugins && /opt/homebrew/Cellar/cmake/3.28.1/bin/cmake -E cmake_link_script CMakeFiles/heif-ffmpegdec.dir/link.txt --verbose=1 /opt/homebrew/Library/Homebrew/shims/mac/super/clang++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -bundle -Wl,-headerpad_max_install_names -o libheif-ffmpegdec.so "CMakeFiles/heif-ffmpegdec.dir/decoder_ffmpeg.cc.o" "CMakeFiles/heif-ffmpegdec.dir/__/error.cc.o" "CMakeFiles/heif-ffmpegdec.dir/__/heif_plugin.cc.o" -Wl,-rpath,/tmp/libheif-20240107-59963-jb96bl/libheif-1.17.6/build/libheif /opt/homebrew/lib/libavcodec.dylib ../libheif.1.17.6.dylib ld: Undefined symbols: _av_version_info, referenced from: ffmpeg_plugin_name() in decoder_ffmpeg.cc.o clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [libheif/plugins/libheif-ffmpegdec.so] Error 1 ``` Who have a clue and can point me where should I look? _P.S: This is part of my tests/home_research of the libheif plugin system to understand what is missing in order to start using it in the python pypi infrastructure..._
[macOS] WITH_FFMPEG_DECODER -> Undefined symbol
https://api.github.com/repos/strukturag/libheif/issues/1095/comments
5
2024-01-07T10:00:42Z
2024-01-07T14:49:28Z
https://github.com/strukturag/libheif/issues/1095
2,069,066,008
1,095
[ "strukturag", "libheif" ]
$ /opt/heif/bin/heif-info --version 1.17.6 libheif: 1.17.6 plugin path: /opt/heif/lib/libheif $ /opt/heif/bin/heif-info /save/axel/alr3/y23/m2306/d2306_wldkrc/IMG_1539.HEIC MIME type: image/heic main brand: heic compatible brands: mif1, MiPr, miaf, MiHB, heic image: 4032x3024 (id=49), primary colorspace: YCbCr, 4:2:0 bit depth: 8 thumbnail: 320x240 color profile: prof alpha channel: no depth channel: no metadata: Exif: 2370 bytes transformations: angle (ccw): 0 region annotations: none properties: Could not decode image Unsupported feature: Unsupported codec
Could not decode image Unsupported feature: Unsupported codec
https://api.github.com/repos/strukturag/libheif/issues/1094/comments
5
2024-01-06T10:57:21Z
2024-01-08T12:55:31Z
https://github.com/strukturag/libheif/issues/1094
2,068,533,886
1,094
[ "strukturag", "libheif" ]
Building w/ Clang 17 fails w/ ``` C:/_/B/src/libheif-1.17.6/libheif/plugins/encoder_kvazaar.cc:480:12: error: variable 'kvzChroma' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 480 | else if (chroma == heif_chroma_444) { | ^~~~~~~~~~~~~~~~~~~~~~~~~ C:/_/B/src/libheif-1.17.6/libheif/plugins/encoder_kvazaar.cc:[544](https://github.com/msys2/MINGW-packages/actions/runs/7408100857/job/20155643547#step:11:545):45: note: uninitialized use occurs here 544 | kvz_picture* pic = api->picture_alloc_csp(kvzChroma, encoded_width, encoded_height); | ^~~~~~~~~ C:/_/B/src/libheif-1.17.6/libheif/plugins/encoder_kvazaar.cc:480:8: note: remove the 'if' if its condition is always true 480 | else if (chroma == heif_chroma_444) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/_/B/src/libheif-1.17.6/libheif/plugins/encoder_kvazaar.cc:456:3: note: variable 'kvzChroma' is declared here 456 | kvz_chroma_format kvzChroma; | ^ 1 error generated. ```
error: variable 'kvzChroma' is used uninitialized
https://api.github.com/repos/strukturag/libheif/issues/1089/comments
3
2024-01-04T10:19:59Z
2024-01-08T09:21:18Z
https://github.com/strukturag/libheif/issues/1089
2,065,377,396
1,089
[ "strukturag", "libheif" ]
Currently the pixbuf loader only supports loading files - it would be great if it also supported saving files, which would enable applications like Pinta (https://github.com/PintaProject/Pinta/issues/653) to support editing `.heic` files
Pixbuf loader: support saving files
https://api.github.com/repos/strukturag/libheif/issues/1088/comments
0
2024-01-03T05:39:13Z
2024-01-03T05:39:13Z
https://github.com/strukturag/libheif/issues/1088
2,063,274,617
1,088
[ "strukturag", "libheif" ]
libheif-1.17.6/libheif/plugins/encoder_jpeg.cc:366:37: error: invalid conversion from 'long unsigned int*' to 'size_t*' {aka 'unsigned int*'} [-Werror=permissive] 366 | jpeg_mem_dest(&cinfo, &outbuffer, &outlength); | ^~~~~~~~~~ | | | long unsigned int*
32-bit compile fails
https://api.github.com/repos/strukturag/libheif/issues/1086/comments
1
2024-01-02T09:11:23Z
2024-01-08T19:18:00Z
https://github.com/strukturag/libheif/issues/1086
2,062,131,236
1,086
[ "strukturag", "libheif" ]
Running libheif's examples in macOS Sonoma 14.2.1 (have not checked earlier macOS versions) gives an error: ``` % /usr/local/bin/heif-info /System/Library/Desktop\ Pictures/Sonoma.heic dyld[92961]: Library not loaded: @rpath/libheif.1.dylib Referenced from: <B7A8B87B-46A4-3205-A732-A4F618AFB2F7> /usr/local/bin/heif-info Reason: no LC_RPATH's found zsh: abort /usr/local/bin/heif-info /System/Library/Desktop\ Pictures/Sonoma.heic ``` Inserting the following at the top of `examples/CMakeLists.txt` fixes the problem ``` set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) ``` which translates to `/usr/local/lib`. (Perhaps the line above should be wrapped between `if (APPLE)` and `endif ()` lines?) _(I admittedly know almost nothing about CMake, so it's not clear if this is the best, most efficient, or most CMake-ish way of fixing this bug. BTW, setting the `DYLD_LIBRARY_PATH` environment variable to `/usr/local/lib` also fixes the problem, but CMake already knows where it is installing the library, so there's no reason to **not** set rpath appropriately.)_
libheif's examples do not run in macOS Sonoma
https://api.github.com/repos/strukturag/libheif/issues/1085/comments
1
2024-01-01T21:22:11Z
2024-01-07T12:17:57Z
https://github.com/strukturag/libheif/issues/1085
2,061,779,362
1,085
[ "strukturag", "libheif" ]
Hi, I just discovered that there is CVE-2023-49460 + CVE-2023-49464 impacting libheif1 when the library is compiled with the `WITH_UNCOMPRESSED_CODEC` option and that the vulnerable function is used. So I asked myself, should this experimental option be enabled by default? There is difference between the Default CMakeLists.txt option (https://github.com/strukturag/libheif/blob/3ebec35955aeff0a24ec132a6a208e60d51ea11d/CMakeLists.txt#L182) and the CMakePresets's default configuration (https://github.com/strukturag/libheif/blob/3ebec35955aeff0a24ec132a6a208e60d51ea11d/CMakePresets.json#L32). If it was by default disabled (as it is in the CMakeLists.txt file), it should be the same for the `default` presets otherwise it is not coherent and the experimental option is enabled by default for all builds. Only the `develop` preset should enable it IMO. The same for all experimental modes IMO to make the default library file more secure. WDYT?
Uncompressed codec enabled by default even if experimental?
https://api.github.com/repos/strukturag/libheif/issues/1084/comments
6
2023-12-31T13:42:52Z
2024-01-07T21:06:35Z
https://github.com/strukturag/libheif/issues/1084
2,061,064,248
1,084
[ "strukturag", "libheif" ]
Exposing the version number in the public header `heif_version.h` is problematic. Client programs might assume that this is the currently installed version, while it is just the libheif version that the client was compiled against. The actually installed libheif version will often be different. Version information should be exclusively obtained through `heif_get_version()` and related functions. Removing this file entirely might break the build process of some clients that erroneously used this file for version information, but it does technically not break binary compatibility. That means, we should be able to remove it even in a minor version upgrade (upcoming v1.18.0). Any objections to that?
`heif_version.h` should be removed
https://api.github.com/repos/strukturag/libheif/issues/1082/comments
7
2023-12-28T19:36:39Z
2024-01-07T21:13:24Z
https://github.com/strukturag/libheif/issues/1082
2,058,763,678
1,082
[ "strukturag", "libheif" ]
Description Memory leaks in function JpegEncoder::Encode Version heif-convert libheif version: 1.17.6 Replay cd libheif mkdir build && cd build export CC=afl-clang-fast CXX=afl-clang-fast++ CFLAGS="-gdwarf-2 -g3 -O0 -fsanitize=address,undefined -fno-omit-frame-pointer" CXXFLAGS="-gdwarf-2 -g3 -O0 -fsanitize=address,undefined -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address,undefined" cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_UNCOMPRESSED_CODEC=ON .. make -j ./examples/heif-convert ./poc21 1.jpg ASAN ==523507==ERROR: LeakSanitizer: detected memory leaks Direct leak of 168 byte(s) in 1 object(s) allocated from: #0 0x55737c4f5b1e in malloc (/usr/local/bin/heif-convert+0xc2b1e) (BuildId: 69e521453ea212a7fb7de9c758d7c06c6558ac42) #1 0x7f30384d157b in jinit_memory_mgr (/lib/x86_64-linux-gnu/libjpeg.so.8+0x3957b) (BuildId: c54abff9294357e28532a76a049a4cb2542fc15b) Direct leak of 100 byte(s) in 1 object(s) allocated from: #0 0x55737c4f5b1e in malloc (/usr/local/bin/heif-convert+0xc2b1e) (BuildId: 69e521453ea212a7fb7de9c758d7c06c6558ac42) #1 0x55737c5332b4 in Encoder::GetExifMetaData(heif_image_handle const*, unsigned long*) /root/fuzz/fuzz_libheif/libheif/examples/encoder.cc:54:43 #2 0x55737c56a3c5 in JpegEncoder::Encode(heif_image_handle const*, heif_image const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /root/fuzz/fuzz_libheif/libheif/examples/encoder_jpeg.cc:174:23 #3 0x55737c54b039 in main /root/fuzz/fuzz_libheif/libheif/examples/heif_convert.cc:509:31 #4 0x7f3037f0dd8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 Indirect leak of 22899 byte(s) in 5 object(s) allocated from: #0 0x55737c4f5b1e in malloc (/usr/local/bin/heif-convert+0xc2b1e) (BuildId: 69e521453ea212a7fb7de9c758d7c06c6558ac42) #1 0x7f30384d0ba5 (/lib/x86_64-linux-gnu/libjpeg.so.8+0x38ba5) (BuildId: c54abff9294357e28532a76a049a4cb2542fc15b) Indirect leak of 20865 byte(s) in 7 object(s) allocated from: #0 0x55737c4f5b1e in malloc (/usr/local/bin/heif-convert+0xc2b1e) (BuildId: 69e521453ea212a7fb7de9c758d7c06c6558ac42) #1 0x7f30384d0de4 (/lib/x86_64-linux-gnu/libjpeg.so.8+0x38de4) (BuildId: c54abff9294357e28532a76a049a4cb2542fc15b) #2 0x60f00000012f (<unknown module>) #3 0x7f30384c4d6f (/lib/x86_64-linux-gnu/libjpeg.so.8+0x2cd6f) (BuildId: c54abff9294357e28532a76a049a4cb2542fc15b) SUMMARY: AddressSanitizer: 44032 byte(s) leaked in 14 allocation(s). POC [poc21.zip](https://github.com/strukturag/libheif/files/13737587/poc21.zip) Environment Description: Ubuntu 22.04.2 LTS gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
Memory leaks in function JpegEncoder::Encode
https://api.github.com/repos/strukturag/libheif/issues/1073/comments
0
2023-12-21T07:52:37Z
2023-12-21T10:51:01Z
https://github.com/strukturag/libheif/issues/1073
2,051,901,212
1,073
[ "strukturag", "libheif" ]
At the end of the year I look at what has changed. A new AV2 codec has arrived, and it is unknown what its future will be. The joke is that you can't install AOM and AVM together because they have the same function names. Is this a transitional version or maybe a new codec? Who knows that. webp2 changed practically nothing. Just added libjxl. It is no longer compatible with the new libavif. The VVC C++11 codec did not appear. There are either trial versions or in C++17 or higher. HEIF example from the movie vvc `MP4Box.exe -add-image output_uvg266.mp4:primary -ab heic -new image.heic` `HEIFinfo_avx.exe image_vvc.heif` `MIME type: image/heif` `main brand: mif1` `compatible brands: mif1, heic` `image: 1920x1080 (id=1), primary` ` colorspace: YCbCr, unknown` ` bit depth: 15,-1` No information about codec type. JpegXS library is still in beta. https://jpeg.org/jpegxs/software.html libjpeg-turbo 8/12/16bit (losseless) codec appeared, but it is unknown whether jpegxt/ls was therefore discontinued and abandoned. How does this relate to heif. As for ffmpeg jpegls is compatible(charls), jpegxt is not. https://github.com/libjpeg-turbo/libjpeg-turbo/commit/be96fa0a403e5d084719757f7b8241d20393246d https://github.com/thorfdbg/libjpeg/commit/9e0cea29d7ba7a2c1e763865391bc94b336da25e https://github.com/team-charls/charls/commit/0f47e2bcbee813aeb1a3c20823a7ddccebe9438b libheif converts j2k,htj2k but can't import and export j2k/ht2k. There is no plugin in ffmpeg cwp2_avx.exe image.jpg -info -q 100 -nometadata -mt -effort 7 -uv_mode 2 -csp 0 -o image.wp2 av1enc_avx.exe -q 100 -444 -size 280x420 -effort 7 -thread 4 -tune butteraugli image.wp2 -d image.av1 av2enc_avx.exe -q 100 -444 -size 280x420 -effort 7 -thread 4 -tune ssim image.wp2 -d image.av2 avifenc_aom_avx.exe -c aom -l -d 8 -y 444 -r full -s 7 -j 4 image.jpg image1.avif avifenc_avm_avx.exe -c avm -l -d 8 -y 444 -r full -s 7 -j 4 image.jpg image2.avif heifenc_avx.exe image.jpg --verbose --avif -L -q 100 -e aom --no-alpha -p speed=7 -p chroma=444 -p threads=4 -p tune=ssim --matrix_coefficients=0 --full_range_flag=1 -o image3.avif heifenc_avx.exe image.jpg --verbose -L -q 100 -e x265 --no-alpha -p chroma=444 -p tune=ssim --matrix_coefficients=0 --full_range_flag=1 -o image1.heif heifenc_avx.exe image.jpg --verbose -L -q 100 -e kvazaar --no-alpha --matrix_coefficients=0 --full_range_flag=1 -o image2.heif heifenc_avx.exe image.jpg --verbose --jpeg2000 -L -q 100 -e openjpeg --no-alpha --matrix_coefficients=0 --full_range_flag=1 -o image3.heif heifenc_avx.exe image.jpg --verbose --htj2k -L -q 100 -e openjph --no-alpha --matrix_coefficients=0 --full_range_flag=1 -o image4.heif
Competition and trends in the github library.
https://api.github.com/repos/strukturag/libheif/issues/1069/comments
5
2023-12-17T07:06:59Z
2024-06-28T08:45:02Z
https://github.com/strukturag/libheif/issues/1069
2,045,091,217
1,069
[ "strukturag", "libheif" ]
Description Null pointer dereference in libheif/uncompressed_image.cc:758 Version heif-convert libheif version: 1.17.5 Replay cd libheif mkdir build && cd build export CC=afl-clang-fast CXX=afl-clang-fast++ CFLAGS="-gdwarf-2 -g3 -O0 -fsanitize=address,undefined -fno-omit-frame-pointer" CXXFLAGS="-gdwarf-2 -g3 -O0 -fsanitize=address,undefined -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address,undefined" cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_UNCOMPRESSED_CODEC=ON .. make -j ./examples/heif-convert ./poc 1.jpg ASAN > ./libheif/libheif/uncompressed_image.cc:758:38: runtime error: null pointer passed as argument 2, which is declared to never be null > /usr/include/string.h:44:28: note: nonnull attribute specified here > SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /root/fuzz/fuzz_libheif/libheif/libheif/uncompressed_image.cc:758:38 in > AddressSanitizer:DEADLYSIGNAL > ================================================================= > ==7188==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f42b8bc9881 bp 0x7ffc1fd46450 sp 0x7ffc1fd45c18 T0) > ==7188==The signal is caused by a READ memory access. > ==7188==Hint: address points to the zero page. > #0 0x7f42b8bc9881 in memcpy string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:222 > #1 0x55c269f58e41 in __asan_memcpy (/root/fuzz/fuzz_libheif/libheif/build/examples/heif-convert+0xbce41) (BuildId: 44557f4cfb7fdf831c1f9a1e1771606fc3207909) > #2 0x7f42ba12af36 in UncompressedImageCodec::decode_uncompressed_image(std::shared_ptr<HeifFile const> const&, unsigned int, std::shared_ptr<HeifPixelImage>&, unsigned int, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&) /root/fuzz/fuzz_libheif/libheif/libheif/uncompressed_image.cc:758:13 > #3 0x7f42b99f2f6e in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const /root/fuzz/fuzz_libheif/libheif/libheif/context.cc:1452:13 > #4 0x7f42b99e6b50 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const /root/fuzz/fuzz_libheif/libheif/libheif/context.cc:1248:15 > #5 0x7f42b989ee64 in heif_decode_image /root/fuzz/fuzz_libheif/libheif/libheif/heif.cc:1041:35 > #6 0x55c269fadbc3 in main /root/fuzz/fuzz_libheif/libheif/examples/heif_convert.cc:484:11 > #7 0x7f42b8b2ed8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16 > #8 0x7f42b8b2ee3f in __libc_start_main csu/../csu/libc-start.c:392:3 > #9 0x55c269ed6be4 in _start (/root/fuzz/fuzz_libheif/libheif/build/examples/heif-convert+0x3abe4) (BuildId: 44557f4cfb7fdf831c1f9a1e1771606fc3207909) > > AddressSanitizer can not provide additional info. > SUMMARY: AddressSanitizer: SEGV string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:222 in memcpy > ==7188==ABORTING POC [poc1214.zip](https://github.com/strukturag/libheif/files/13668025/poc1214.zip) Environment Description: Ubuntu 22.04.2 LTS gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
Null pointer dereference in UncompressedImageCodec::decode_uncompressed_image
https://api.github.com/repos/strukturag/libheif/issues/1065/comments
0
2023-12-14T03:35:54Z
2023-12-14T12:27:12Z
https://github.com/strukturag/libheif/issues/1065
2,040,842,864
1,065
[ "strukturag", "libheif" ]
```shell [root@VM-8-3-centos imageMagick]# heif-convert --list-decoders HEIC decoders: AVIF decoders: JPEG decoders: - jpeg = libjpeg-turbo 1.2.90 (libjpeg 6.2) JPEG 2000 decoders: uncompressed: yes [root@VM-8-3-centos imageMagick]# heif-convert -q 100 IMG_0376.HEIC -o jpg.jpg File contains 1 image Could not decode image: 0: Unsupported feature: Unsupported codec [root@VM-8-3-centos imageMagick]# heif-convert -v 1.17.5 libheif: 1.17.5 plugin path: /usr/local/lib64/libheif [root@VM-8-3-centos imageMagick]# heif-info IMG_0376.HEIC MIME type: image/heic main brand: heic compatible brands: mif1, MiHE, MiPr, miaf, MiHB, heic image: 3024x4032 (id=49), primary colorspace: YCbCr, 4:2:0 bit depth: 8 thumbnail: 240x320 color profile: prof alpha channel: no depth channel: no metadata: Exif: 2320 bytes transformations: angle (ccw): 270 region annotations: none properties: Could not decode image Unsupported feature: Unsupported codec ``` This is my version and the specific command used. How should I handle it to successfully convert it? ![image](https://github.com/strukturag/libheif/assets/42542308/5341d8a1-c183-4b8c-9bbe-413cbcd5a914)
Unsupported feature: Unsupported codec
https://api.github.com/repos/strukturag/libheif/issues/1063/comments
1
2023-12-12T05:59:30Z
2023-12-14T12:17:27Z
https://github.com/strukturag/libheif/issues/1063
2,037,041,607
1,063
[ "strukturag", "libheif" ]
I want to static link libheif.a (on macOS) but got this problem: ``` ld: Undefined symbols: _inflate, referenced from: ``` `libheif.a` was built using options: ``` preset=release-noplugins WITH_AOM_DECODER=OFF WITH_AOM_ENCODER=OFF WITH_JPEG_DECODER=OFF WITH_JPEG_ENCODER=OFF WITH_EXAMPLES=OFF ``` And pkg-config output has no zlib: ``` PKG_CONFIG_PATH=/out/libheif/lib/pkgconfig pkg-config --libs --static libheif ``` ``` -L/out/libheif/lib -L/opt/homebrew/Cellar/libde265/1.0.14/lib -L/opt/homebrew/Cellar/x265/3.5/lib -L/opt/homebrew/Cellar/webp/1.3.2/lib -lheif -lc++ -lde265 -lstdc++ -lx265 -lc++ -ldl -lsharpyuv ``` I guess because zlib is not list in `Requires.private` or `Libs.private` or some else place.
ZLIB not listed in Requires.private
https://api.github.com/repos/strukturag/libheif/issues/1057/comments
6
2023-12-04T08:38:13Z
2023-12-15T15:24:46Z
https://github.com/strukturag/libheif/issues/1057
2,023,311,289
1,057
[ "strukturag", "libheif" ]
### Description AddressSanitizer: SEGV in `decode_uncompressed_image` ### Version ``` commit: 64ece913266609789f5dc70fe7de9eb759badd7f heif-convert libheif version: 1.17.5 ------------------------------------------- Usage: heif-convert [options] <input-image> [output-image] The program determines the output file format from the output filename suffix. These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used. Options: -h, --help show help -v, --version show version -q, --quality quality (for JPEG output) -o, --output FILENAME write output to FILENAME (optional) -d, --decoder ID use a specific decoder (see --list-decoders) --with-aux also write auxiliary images (e.g. depth images) --with-xmp write XMP metadata to file (output filename with .xmp suffix) --with-exif write EXIF metadata to file (output filename with .exif suffix) --skip-exif-offset skip EXIF metadata offset bytes --no-colons replace ':' characters in auxiliary image filenames with '_' --list-decoders list all available decoders (built-in and plugins) --quiet do not output status messages to console -C, --chroma-upsampling ALGO Force chroma upsampling algorithm (nn = nearest-neighbor / bilinear) --png-compression-level # Set to integer between 0 (fastest) and 9 (best). Use -1 for default. ``` ### Replay ``` cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_UNCOMPRESSED_CODEC=ON .. make -j ./examples/heif-convert ./poc test.png ``` ### ASAN ``` ==89344==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f955d086aeb bp 0x7ffdd923ebb0 sp 0x7ffdd923e318 T0) ==89344==The signal is caused by a READ memory access. ==89344==Hint: address points to the zero page. #0 0x7f955d086aea in memcpy (/lib/x86_64-linux-gnu/libc.so.6+0xbbaea) #1 0x7f955d85f4de (/lib/x86_64-linux-gnu/libasan.so.4+0x7a4de) #2 0x7f955d6f8495 in UncompressedImageCodec::decode_uncompressed_image(std::shared_ptr<HeifFile const> const&, unsigned int, std::shared_ptr<HeifPixelImage>&, unsigned int, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&) libheif/libheif/uncompressed_image.cc:758 #3 0x7f955d5b7304 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const libheif/libheif/context.cc:1452 #4 0x7f955d5b42a8 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const libheif/libheif/context.cc:1248 #5 0x7f955d5771f4 in heif_decode_image libheif/libheif/heif.cc:1044 #6 0x55e9351aca11 in main libheif/examples/heif_convert.cc:484 #7 0x7f955cfef082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #8 0x55e9351a7add in _start (libheif/build/examples/heif-convert+0xbadd) ``` ### POC - [poc](https://github.com/fdu-sec/poc/raw/main/libheif/poc5) ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ### Credit Yuchuan Meng ([Fudan University](https://secsys.fudan.edu.cn/))
AddressSanitizer: SEGV in `decode_uncompressed_image`
https://api.github.com/repos/strukturag/libheif/issues/1046/comments
2
2023-11-22T12:10:09Z
2023-12-14T15:36:32Z
https://github.com/strukturag/libheif/issues/1046
2,006,207,463
1,046
[ "strukturag", "libheif" ]
### Description heap-use-after-free/SEGV/heap-buffer-overflow in `UncompressedImageCodec::decode_uncompressed_image` ### Version ``` commit: 64ece913266609789f5dc70fe7de9eb759badd7f heif-convert libheif version: 1.17.5 ------------------------------------------- Usage: heif-convert [options] <input-image> [output-image] The program determines the output file format from the output filename suffix. These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used. Options: -h, --help show help -v, --version show version -q, --quality quality (for JPEG output) -o, --output FILENAME write output to FILENAME (optional) -d, --decoder ID use a specific decoder (see --list-decoders) --with-aux also write auxiliary images (e.g. depth images) --with-xmp write XMP metadata to file (output filename with .xmp suffix) --with-exif write EXIF metadata to file (output filename with .exif suffix) --skip-exif-offset skip EXIF metadata offset bytes --no-colons replace ':' characters in auxiliary image filenames with '_' --list-decoders list all available decoders (built-in and plugins) --quiet do not output status messages to console -C, --chroma-upsampling ALGO Force chroma upsampling algorithm (nn = nearest-neighbor / bilinear) --png-compression-level # Set to integer between 0 (fastest) and 9 (best). Use -1 for default. ``` ### Replay ``` cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_UNCOMPRESSED_CODEC=ON .. make -j ./examples/heif-convert ./poc test.png ``` ### ASAN > I just show the bof case, you can use my poc to reproduce the others. ``` ================================================================= ==88945==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x613000000528 at pc 0x7fd270526821 bp 0x7ffc3ade57f0 sp 0x7ffc3ade57e0 READ of size 1 at 0x613000000528 thread T0 #0 0x7fd270526820 in UncompressedImageCodec::decode_uncompressed_image(std::shared_ptr<HeifFile const> const&, unsigned int, std::shared_ptr<HeifPixelImage>&, unsigned int, unsigned int, std::vector<unsigned char, std::allocator<unsigned char> > const&) libheif/libheif/uncompressed_image.cc:784 #1 0x7fd2703e5304 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const libheif/libheif/context.cc:1452 #2 0x7fd2703e22a8 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const libheif/libheif/context.cc:1248 #3 0x7fd2703a51f4 in heif_decode_image libheif/libheif/heif.cc:1044 #4 0x5590cf2fca11 in main libheif/examples/heif_convert.cc:484 #5 0x7fd26fe1d082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #6 0x5590cf2f7add in _start (libheif/build/examples/heif-convert+0xbadd) 0x613000000528 is located 30 bytes to the right of 330-byte region [0x6130000003c0,0x61300000050a) allocated by thread T0 here: #0 0x7fd2706f4258 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.4+0xe1258) #1 0x5590cf2f97b4 in __gnu_cxx::new_allocator<unsigned char>::allocate(unsigned long, void const*) /usr/include/c++/7/ext/new_allocator.h:111 #2 0x5590cf2f9286 in std::allocator_traits<std::allocator<unsigned char> >::allocate(std::allocator<unsigned char>&, unsigned long) /usr/include/c++/7/bits/alloc_traits.h:436 #3 0x5590cf2f8fb5 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_allocate(unsigned long) /usr/include/c++/7/bits/stl_vector.h:172 #4 0x5590cf2f8864 in std::vector<unsigned char, std::allocator<unsigned char> >::_M_default_append(unsigned long) /usr/include/c++/7/bits/vector.tcc:571 #5 0x5590cf2f84c6 in std::vector<unsigned char, std::allocator<unsigned char> >::resize(unsigned long) /usr/include/c++/7/bits/stl_vector.h:692 #6 0x7fd27032e7ff in Box_iloc::read_data(Box_iloc::Item const&, std::shared_ptr<StreamReader> const&, std::shared_ptr<Box_idat> const&, std::vector<unsigned char, std::allocator<unsigned char> >*) const libheif/libheif/box.cc:1252 #7 0x7fd2704238bc in HeifFile::get_compressed_image_data(unsigned int, std::vector<unsigned char, std::allocator<unsigned char> >*) const libheif/libheif/file.cc:900 #8 0x7fd2703e50f9 in HeifContext::decode_image_planar(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const libheif/libheif/context.cc:1448 #9 0x7fd2703e22a8 in HeifContext::decode_image_user(unsigned int, std::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const libheif/libheif/context.cc:1248 #10 0x7fd2703a51f4 in heif_decode_image libheif/libheif/heif.cc:1044 #11 0x5590cf2fca11 in main libheif/examples/heif_convert.cc:484 #12 0x7fd26fe1d082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) ``` ### POC - [poc-heap-overflow](https://github.com/fdu-sec/poc/raw/main/libheif/poc4-hbof) - [poc-heap-uaf](https://github.com/fdu-sec/poc/raw/main/libheif/poc4-huaf) - [poc-segv](https://github.com/fdu-sec/poc/raw/main/libheif/poc4-segv) ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ### Credit Yuchuan Meng ([Fudan University](https://secsys.fudan.edu.cn/))
heap-use-after-free/SEGV/heap-buffer-overflow in UncompressedImageCodec::decode_uncompressed_image
https://api.github.com/repos/strukturag/libheif/issues/1045/comments
1
2023-11-22T12:03:58Z
2024-01-04T02:40:11Z
https://github.com/strukturag/libheif/issues/1045
2,006,197,224
1,045
[ "strukturag", "libheif" ]
### Description heap-use-after-free/SEGV/heap-buffer-overflow `libheif/libheif/uncompressed_image.cc:537` in `UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci` ### Version ``` commit: 64ece913266609789f5dc70fe7de9eb759badd7f heif-convert libheif version: 1.17.5 ------------------------------------------- Usage: heif-convert [options] <input-image> [output-image] The program determines the output file format from the output filename suffix. These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used. Options: -h, --help show help -v, --version show version -q, --quality quality (for JPEG output) -o, --output FILENAME write output to FILENAME (optional) -d, --decoder ID use a specific decoder (see --list-decoders) --with-aux also write auxiliary images (e.g. depth images) --with-xmp write XMP metadata to file (output filename with .xmp suffix) --with-exif write EXIF metadata to file (output filename with .exif suffix) --skip-exif-offset skip EXIF metadata offset bytes --no-colons replace ':' characters in auxiliary image filenames with '_' --list-decoders list all available decoders (built-in and plugins) --quiet do not output status messages to console -C, --chroma-upsampling ALGO Force chroma upsampling algorithm (nn = nearest-neighbor / bilinear) --png-compression-level # Set to integer between 0 (fastest) and 9 (best). Use -1 for default. ``` ### Replay ``` cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_UNCOMPRESSED_CODEC=ON .. make -j ./examples/heif-convert ./poc test.png ``` ### ASAN > I just show the uaf case, you can use my poc to reproduce the others. ``` ==88148==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e000000910 at pc 0x7f7a88d9ab47 bp 0x7ffef17996e0 sp 0x7ffef17996d0 READ of size 2 at 0x60e000000910 thread T0 #0 0x7f7a88d9ab46 in UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci(HeifFile const&, unsigned int) libheif/libheif/uncompressed_image.cc:537 #1 0x7f7a88c96f95 in HeifFile::get_luma_bits_per_pixel_from_configuration(unsigned int) const libheif/libheif/file.cc:609 #2 0x7f7a88c58d54 in HeifContext::Image::get_luma_bits_per_pixel() const libheif/libheif/context.cc:1225 #3 0x7f7a88c1abf7 in heif_image_handle_get_luma_bits_per_pixel libheif/libheif/heif.cc:846 #4 0x55fa40c34835 in main libheif/examples/heif_convert.cc:475 #5 0x7f7a88694082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) #6 0x55fa40c2fadd in _start (libheif/build/examples/heif-convert+0xbadd) 0x60e000000910 is located 16 bytes inside of 160-byte region [0x60e000000900,0x60e0000009a0) freed by thread T0 here: #0 0x7f7a88f6c0d0 in operator delete(void*) (/lib/x86_64-linux-gnu/libasan.so.4+0xe20d0) #1 0x7f7a88c038d9 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> >::deallocate(std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) /usr/include/c++/7/ext/new_allocator.h:125 #2 0x7f7a88bfef61 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> > >::deallocate(std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> >&, std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2>*, unsigned long) /usr/include/c++/7/bits/alloc_traits.h:462 #3 0x7f7a88bf4553 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> > >::~__allocated_ptr() /usr/include/c++/7/bits/allocated_ptr.h:73 #4 0x7f7a88c1019d in std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2>::_M_destroy() /usr/include/c++/7/bits/shared_ptr_base.h:543 #5 0x7f7a88b94163 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/7/bits/shared_ptr_base.h:170 #6 0x7f7a88b938c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/7/bits/shared_ptr_base.h:684 #7 0x7f7a88bc23e3 in std::__shared_ptr<Box, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/7/bits/shared_ptr_base.h:1123 #8 0x7f7a88bc24a3 in std::shared_ptr<Box>::~shared_ptr() /usr/include/c++/7/bits/shared_ptr.h:93 #9 0x7f7a88be9854 in void std::_Destroy<std::shared_ptr<Box> >(std::shared_ptr<Box>*) /usr/include/c++/7/bits/stl_construct.h:98 #10 0x7f7a88be4eb8 in void std::_Destroy_aux<false>::__destroy<std::shared_ptr<Box>*>(std::shared_ptr<Box>*, std::shared_ptr<Box>*) /usr/include/c++/7/bits/stl_construct.h:108 #11 0x7f7a88bdafef in void std::_Destroy<std::shared_ptr<Box>*>(std::shared_ptr<Box>*, std::shared_ptr<Box>*) /usr/include/c++/7/bits/stl_construct.h:137 #12 0x7f7a88bce3b8 in void std::_Destroy<std::shared_ptr<Box>*, std::shared_ptr<Box> >(std::shared_ptr<Box>*, std::shared_ptr<Box>*, std::allocator<std::shared_ptr<Box> >&) /usr/include/c++/7/bits/stl_construct.h:206 #13 0x7f7a88bc3acf in std::vector<std::shared_ptr<Box>, std::allocator<std::shared_ptr<Box> > >::~vector() /usr/include/c++/7/bits/stl_vector.h:434 #14 0x7f7a88bc02f8 in Box::~Box() (libheif/build/libheif/libheif.so.1+0xa22f8) #15 0x7f7a88bc053e in FullBox::~FullBox() (libheif/build/libheif/libheif.so.1+0xa253e) #16 0x7f7a88c09a8c in Box_meta::~Box_meta() (libheif/build/libheif/libheif.so.1+0xeba8c) #17 0x7f7a88c12579 in void __gnu_cxx::new_allocator<Box_meta>::destroy<Box_meta>(Box_meta*) /usr/include/c++/7/ext/new_allocator.h:140 #18 0x7f7a88c111de in void std::allocator_traits<std::allocator<Box_meta> >::destroy<Box_meta>(std::allocator<Box_meta>&, Box_meta*) /usr/include/c++/7/bits/alloc_traits.h:487 #19 0x7f7a88c10310 in std::_Sp_counted_ptr_inplace<Box_meta, std::allocator<Box_meta>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/7/bits/shared_ptr_base.h:535 #20 0x7f7a88b940ec in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/7/bits/shared_ptr_base.h:154 #21 0x7f7a88b938c3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/7/bits/shared_ptr_base.h:684 #22 0x7f7a88bc23e3 in std::__shared_ptr<Box, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/7/bits/shared_ptr_base.h:1123 #23 0x7f7a88bc24a3 in std::shared_ptr<Box>::~shared_ptr() /usr/include/c++/7/bits/shared_ptr.h:93 #24 0x7f7a88b9d8b5 in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:436 #25 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #26 0x7f7a88bab707 in Box_iprp::parse(BitstreamRange&) libheif/libheif/box.cc:1731 #27 0x7f7a88b9d7eb in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:672 #28 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #29 0x7f7a88ba14a0 in Box_meta::parse(BitstreamRange&) libheif/libheif/box.cc:920 previously allocated by thread T0 here: #0 0x7f7a88f6b258 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.4+0xe1258) #1 0x7f7a88c038a8 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/include/c++/7/ext/new_allocator.h:111 #2 0x7f7a88bfeeb4 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/include/c++/7/bits/alloc_traits.h:436 #3 0x7f7a88bf44b9 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<Box_hdlr, std::allocator<Box_hdlr>, (__gnu_cxx::_Lock_policy)2> >&) /usr/include/c++/7/bits/allocated_ptr.h:104 #4 0x7f7a88bea393 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<Box_hdlr, std::allocator<Box_hdlr>>(std::_Sp_make_shared_tag, Box_hdlr*, std::allocator<Box_hdlr> const&) /usr/include/c++/7/bits/shared_ptr_base.h:635 #5 0x7f7a88be5955 in std::__shared_ptr<Box_hdlr, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<Box_hdlr>>(std::_Sp_make_shared_tag, std::allocator<Box_hdlr> const&) /usr/include/c++/7/bits/shared_ptr_base.h:1295 #6 0x7f7a88bdc441 in std::shared_ptr<Box_hdlr>::shared_ptr<std::allocator<Box_hdlr>>(std::_Sp_make_shared_tag, std::allocator<Box_hdlr> const&) /usr/include/c++/7/bits/shared_ptr.h:344 #7 0x7f7a88bcf8a2 in std::shared_ptr<Box_hdlr> std::allocate_shared<Box_hdlr, std::allocator<Box_hdlr>>(std::allocator<Box_hdlr> const&) /usr/include/c++/7/bits/shared_ptr.h:691 #8 0x7f7a88bc4768 in std::shared_ptr<Box_hdlr> std::make_shared<Box_hdlr>() /usr/include/c++/7/bits/shared_ptr.h:707 #9 0x7f7a88b9bcf3 in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:448 #10 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #11 0x7f7a88ba14a0 in Box_meta::parse(BitstreamRange&) libheif/libheif/box.cc:920 #12 0x7f7a88b9d7eb in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:672 #13 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #14 0x7f7a88bab707 in Box_iprp::parse(BitstreamRange&) libheif/libheif/box.cc:1731 #15 0x7f7a88b9d7eb in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:672 #16 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #17 0x7f7a88ba14a0 in Box_meta::parse(BitstreamRange&) libheif/libheif/box.cc:920 #18 0x7f7a88b9d7eb in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:672 #19 0x7f7a88b9edac in Box::read_children(BitstreamRange&, int) libheif/libheif/box.cc:749 #20 0x7f7a88ba14a0 in Box_meta::parse(BitstreamRange&) libheif/libheif/box.cc:920 #21 0x7f7a88b9d7eb in Box::read(BitstreamRange&, std::shared_ptr<Box>*) libheif/libheif/box.cc:672 #22 0x7f7a88c9217e in HeifFile::parse_heif_file(BitstreamRange&) libheif/libheif/file.cc:254 #23 0x7f7a88c8ffc6 in HeifFile::read(std::shared_ptr<StreamReader> const&) libheif/libheif/file.cc:107 #24 0x7f7a88c8f8c6 in HeifFile::read_from_file(char const*) libheif/libheif/file.cc:88 #25 0x7f7a88c4b3d7 in HeifContext::read_from_file(char const*) libheif/libheif/context.cc:429 #26 0x7f7a88c163ff in heif_context_read_from_file libheif/libheif/heif.cc:451 #27 0x55fa40c33e68 in main libheif/examples/heif_convert.cc:410 #28 0x7f7a88694082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) SUMMARY: AddressSanitizer: heap-use-after-free libheif/libheif/uncompressed_image.cc:537 in UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci(HeifFile const&, unsigned int) Shadow bytes around the buggy address: 0x0c1c7fff80d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff80e0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c1c7fff80f0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x0c1c7fff8100: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff8110: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa =>0x0c1c7fff8120: fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff8130: fd fd fd fd fa fa fa fa fa fa fa fa fd fd fd fd 0x0c1c7fff8140: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa 0x0c1c7fff8150: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c1c7fff8160: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa 0x0c1c7fff8170: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==88148==ABORTING ``` ### POC - [poc-heap-overflow](https://github.com/fdu-sec/poc/raw/main/libheif/poc3-hof) - [poc-heap-uaf](https://github.com/fdu-sec/poc/raw/main/libheif/poc3-huaf) - [poc-segv](https://github.com/fdu-sec/poc/raw/main/libheif/poc3-segv) ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ### Credit Yuchuan Meng ([Fudan University](https://secsys.fudan.edu.cn/))
heap-use-after-free/SEGV/heap-buffer-overflow in UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci
https://api.github.com/repos/strukturag/libheif/issues/1044/comments
1
2023-11-22T11:55:49Z
2023-12-07T20:31:37Z
https://github.com/strukturag/libheif/issues/1044
2,006,182,548
1,044
[ "strukturag", "libheif" ]
### Description SEGV `libheif/libheif/exif.cc:55` in `read16` ### Version ``` heif-convert libheif version: 1.17.5 ------------------------------------------- Usage: heif-convert [options] <input-image> [output-image] The program determines the output file format from the output filename suffix. These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used. Options: -h, --help show help -v, --version show version -q, --quality quality (for JPEG output) -o, --output FILENAME write output to FILENAME (optional) -d, --decoder ID use a specific decoder (see --list-decoders) --with-aux also write auxiliary images (e.g. depth images) --with-xmp write XMP metadata to file (output filename with .xmp suffix) --with-exif write EXIF metadata to file (output filename with .exif suffix) --skip-exif-offset skip EXIF metadata offset bytes --no-colons replace ':' characters in auxiliary image filenames with '_' --list-decoders list all available decoders (built-in and plugins) --quiet do not output status messages to console -C, --chroma-upsampling ALGO Force chroma upsampling algorithm (nn = nearest-neighbor / bilinear) --png-compression-level # Set to integer between 0 (fastest) and 9 (best). Use -1 for default. ``` ### Replay ``` cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake --preset=release .. make -j ./examples/heif-convert ./poc test.png ``` ### ASAN ``` ==1926429==ERROR: AddressSanitizer: SEGV on unknown address 0x60b080000729 (pc 0x55abe2b1012c bp 0x000000000000 sp 0x7ffe0b2df5a0 T0) ==1926429==The signal is caused by a READ memory access. #0 0x55abe2b1012c in read16 /eva/put/libheif/libheif/exif.cc:55 #1 0x55abe2b1012c in find_exif_tag /eva/put/libheif/libheif/exif.cc:103 #2 0x55abe2b1136b in modify_exif_tag_if_it_exists(unsigned char*, int, unsigned short, unsigned short) /eva/put/libheif/libheif/exif.cc:124 #3 0x55abe2b1136b in modify_exif_orientation_tag_if_it_exists(unsigned char*, int, unsigned short) /eva/put/libheif/libheif/exif.cc:140 #4 0x55abe2b16c75 in PngEncoder::Encode(heif_image_handle const*, heif_image const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /eva/put/libheif/examples/encoder_png.cc:126 #5 0x55abe2b00c99 in main /eva/put/libheif/examples/heif_convert.cc:509 #6 0x7fb15dc29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #7 0x7fb15dc29e3f in __libc_start_main_impl ../csu/libc-start.c:392 #8 0x55abe2b09254 in _start (/eva/asan-bin/NestFuzz/libheif/heif-convert+0x15254) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /eva/put/libheif/libheif/exif.cc:55 in read16 ==1926429==ABORTING ``` ### POC [poc](https://github.com/fdu-sec/poc/raw/main/libheif/poc2) ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ### Credit Yuchuan Meng ([Fudan University](https://secsys.fudan.edu.cn/))
SEGV libheif/libheif/exif.cc:55 in read16
https://api.github.com/repos/strukturag/libheif/issues/1043/comments
2
2023-11-22T09:15:02Z
2023-12-14T15:09:47Z
https://github.com/strukturag/libheif/issues/1043
2,005,894,442
1,043
[ "strukturag", "libheif" ]
### Description SEGV `libheif/libheif/exif.cc:88` in `find_exif_tag` ### Version ``` heif-convert libheif version: 1.17.5 ------------------------------------------- Usage: heif-convert [options] <input-image> [output-image] The program determines the output file format from the output filename suffix. These suffixes are recognized: jpg, jpeg, png, y4m. If no output filename is specified, 'jpg' is used. Options: -h, --help show help -v, --version show version -q, --quality quality (for JPEG output) -o, --output FILENAME write output to FILENAME (optional) -d, --decoder ID use a specific decoder (see --list-decoders) --with-aux also write auxiliary images (e.g. depth images) --with-xmp write XMP metadata to file (output filename with .xmp suffix) --with-exif write EXIF metadata to file (output filename with .exif suffix) --skip-exif-offset skip EXIF metadata offset bytes --no-colons replace ':' characters in auxiliary image filenames with '_' --list-decoders list all available decoders (built-in and plugins) --quiet do not output status messages to console -C, --chroma-upsampling ALGO Force chroma upsampling algorithm (nn = nearest-neighbor / bilinear) --png-compression-level # Set to integer between 0 (fastest) and 9 (best). Use -1 for default. ``` ### Replay ``` cd libheif mkdir build && cd build CC="gcc -fsanitize=address" CXX="g++ -fsanitize=address" cmake --preset=release .. make -j ./examples/heif-convert ./poc test.png ``` ### ASAN ``` ================================================================= ==216883==ERROR: AddressSanitizer: SEGV on unknown address 0x60b0b184d2bc (pc 0x55f4628c3ca8 bp 0x00004e7b34c8 sp 0x7ffe414d49b0 T0) ==216883==The signal is caused by a READ memory access. #0 0x55f4628c3ca8 in find_exif_tag eva/put/libheif/libheif/exif.cc:88 #1 0x55f4628c536b in modify_exif_tag_if_it_exists(unsigned char*, int, unsigned short, unsigned short) eva/put/libheif/libheif/exif.cc:124 #2 0x55f4628c536b in modify_exif_orientation_tag_if_it_exists(unsigned char*, int, unsigned short) eva/put/libheif/libheif/exif.cc:140 #3 0x55f4628cac75 in PngEncoder::Encode(heif_image_handle const*, heif_image const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) eva/put/libheif/examples/encoder_png.cc:126 #4 0x55f4628b4c99 in main eva/put/libheif/examples/heif_convert.cc:509 #5 0x7fb342a29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #6 0x7fb342a29e3f in __libc_start_main_impl ../csu/libc-start.c:392 #7 0x55f4628bd254 in _start (eva/put/libheif/build/examples/heif-convert+0x15254) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV eva/put/libheif/libheif/exif.cc:88 in find_exif_tag ==216883==ABORTING ``` ### POC [poc](https://github.com/fdu-sec/poc/raw/main/libheif/poc1) ### Environment ``` Description: Ubuntu 22.04.2 LTS gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 ``` ### Credit Yuchuan Meng ([Fudan University](https://secsys.fudan.edu.cn/))
SEGV libheif/libheif/exif.cc:88 in find_exif_tag
https://api.github.com/repos/strukturag/libheif/issues/1042/comments
1
2023-11-22T09:11:42Z
2023-12-14T12:38:24Z
https://github.com/strukturag/libheif/issues/1042
2,005,888,692
1,042
[ "strukturag", "libheif" ]
good day, as mentioned here: https://github.com/tonycoz/imager/issues/511 i am experiencing what appears to be extreme growth (500-750MB) in VSZ when reading in a relatively-small (2MB) file. ``` PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4280 sburton 20 0 752.5m 47.0m 14.5m S 362.5 0.6 0:00.64 /usr/local/bin/heif-info /tmp/00600919-CJg-7HLh.heic ``` library versions: ``` ~$ locate .so | grep -F -e heif -e heic -e libde265 | xargs -r ls -lrt lrwxrwxrwx 1 root root 12 Nov 4 15:16 /usr/local/lib/libheif.so -> libheif.so.1 -rwxr-xr-x 1 root root 6479808 Nov 10 16:01 /usr/local/lib/libde265.so.0.1.5 lrwxrwxrwx 1 root root 17 Nov 10 16:01 /usr/local/lib/libde265.so.0 -> libde265.so.0.1.5 lrwxrwxrwx 1 root root 17 Nov 10 16:01 /usr/local/lib/libde265.so -> libde265.so.0.1.5 lrwxrwxrwx 1 root root 17 Nov 10 16:14 /usr/local/lib/libheif.so.1 -> libheif.so.1.17.3 -rw-r--r-- 1 root root 3537432 Nov 11 03:13 /usr/local/lib/libheif.so.1.17.3 ``` i have compiled libheif with the following: ``` === Summary of compiled codecs === libde265 HEVC decoder : + separate plugin FFMPEG HEVC decoder (HW acc) : + separate plugin x265 HEVC encoder : + separate plugin Kvazaar HEVC encoder : - disabled AOM AV1 decoder : - disabled AOM AV1 encoder : - disabled Dav1d AV1 decoder : - disabled SVT AV1 encoder : - disabled Rav1e AV1 encoder : - disabled JPEG decoder : - disabled JPEG encoder : - disabled OpenJPEG J2K decoder : - disabled OpenJPEG J2K encoder : - disabled libsharpyuv: disabled ``` for context, i discovered this because i am reading and dynamically manipulating this image within an apache context and this is causing my apache children to consume well more than their usual amount of RAM. please let me know if there is anything critical that i have omitted. cheers [00600919-CJg-7HLh.zip](https://github.com/strukturag/libheif/files/13324361/00600919-CJg-7HLh.zip)
high RAM usage when reading in 2MB .heic file
https://api.github.com/repos/strukturag/libheif/issues/1032/comments
23
2023-11-11T03:56:29Z
2024-01-04T01:34:16Z
https://github.com/strukturag/libheif/issues/1032
1,988,706,072
1,032
[ "strukturag", "libheif" ]
Discovered during testing when I was trying to add the ability to write the HEIF orientation for Pillow-Heif. Can be reproduced using heif-enc, attached two samples. [test_png.zip](https://github.com/strukturag/libheif/files/13250611/test_png.zip)
Wrong orientation processing for 4 / 7
https://api.github.com/repos/strukturag/libheif/issues/1026/comments
12
2023-11-03T13:24:15Z
2023-11-03T16:23:32Z
https://github.com/strukturag/libheif/issues/1026
1,976,201,053
1,026
[ "strukturag", "libheif" ]
ERROR: type should be string, got "https://github.com/strukturag/libheif/blob/c469dcbd8b70c32a51c393ecfc5c591c681868e1/libheif/heif.cc#L96C1-L99C1\r\n\r\nThis method (along with its `_major` and `_maintenance` counterparts) assume that the version number parts use a packed BCD encoding, when it actually does not.\r\nIn practice, `LIBHEIF_NUMERIC_VERSION` packs the decimal version numbers into a 32-bit integer without BCD encoding, e.g. `#define LIBHEIF_NUMERIC_VERSION ((1<<24) | (17<<16) | (1<<8) | 0)`\r\n\r\nThis bug can be reproduced with the following program:\r\n```c++\r\n#include <stdio.h>\r\n#include \"libheif/heif.h\"\r\n\r\nint main()\r\n{\r\n printf(\"%s\\n\", heif_get_version());\r\n printf(\"0x%08x\\n\", heif_get_version_number());\r\n printf(\"%d.%d.%d\\n\", heif_get_version_number_major(), heif_get_version_number_minor(), heif_get_version_number_maintenance());\r\n}\r\n```\r\n\r\nIt produces the following output:\r\n\r\n```\r\n1.17.1\r\n0x01110100\r\n1.11.1\r\n```\r\n\r\nI think the fix would be to remove the `bcd2dec` method call, and update the API documentation to remove the references to BCD encoding."
Incorrect result from `heif_get_version_number_minor`
https://api.github.com/repos/strukturag/libheif/issues/1023/comments
1
2023-11-02T16:42:21Z
2023-11-02T17:00:14Z
https://github.com/strukturag/libheif/issues/1023
1,974,646,720
1,023
[ "strukturag", "libheif" ]
Boxes with a zero size field often raise issues when trying to read the whole box. There is often code like `box_size - header_size` which then gives a negative overflow. We either have to fix this in every box that does this or we have to explicitly restrict the usage of boxes with a zero size field to some types like `mbox`.
General handling of boxes with zero (undefined) size
https://api.github.com/repos/strukturag/libheif/issues/1021/comments
0
2023-11-02T10:43:56Z
2023-11-02T10:45:24Z
https://github.com/strukturag/libheif/issues/1021
1,973,974,704
1,021
[ "strukturag", "libheif" ]
Hello, I struggle to install heif lib on Docker base on `public.ecr.aws/lambda/go:1.2023.10.24.16`. Here is my Docker file ``` FROM public.ecr.aws/lambda/go:1.2023.10.24.16 RUN yum upgrade -y RUN yum groupinstall 'Development Tools' -y # https://www.cyberciti.biz/faq/centos-linux-install-gcc-c-c-compiler/ RUN yum install epel-release cmake cmake3 wget libpng-devel libjpeg-turbo-devel giflib-devel libtiff-devel graphviz hg -y RUN yum update -y ARG WEBP_VERSION=1.3.2 RUN wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$WEBP_VERSION.tar.gz && \ tar -xvzf libwebp-$WEBP_VERSION.tar.gz && \ mv libwebp-$WEBP_VERSION libwebp && \ rm libwebp-$WEBP_VERSION.tar.gz && \ cd ./libwebp && \ ./configure && \ make && \ make install && \ rm -rf libwebp && \ cd .. RUN hg clone http://hg.videolan.org/x265 && \ cd x265/build/linux && \ cmake -G "Unix Makefiles" ../../source && \ make && \ make install && \ cd ../../.. && \ rm -rf x265 ARG LIB265_VERSION=1.0.12 RUN wget https://github.com/strukturag/libde265/releases/download/v$LIB265_VERSION/libde265-$LIB265_VERSION.tar.gz && \ tar -xvzf libde265-$LIB265_VERSION.tar.gz && \ mv libde265-$LIB265_VERSION libde265 && \ rm libde265-$LIB265_VERSION.tar.gz && \ cd ./libde265 && \ ./autogen.sh && \ ./configure && \ make && \ make install && \ rm -rf libde265 && \ cd .. ARG HEIF_VERSION=1.17.1 RUN wget https://github.com/strukturag/libheif/releases/download/v$HEIF_VERSION/libheif-$HEIF_VERSION.tar.gz && \ tar -xvzf libheif-$HEIF_VERSION.tar.gz && \ mv libheif-$HEIF_VERSION libheif && \ rm libheif-$HEIF_VERSION.tar.gz && \ cd ./libheif && \ mkdir build && \ cd build && \ cmake3 --preset=release .. && \ make && \ cd ../.. && \ rm -rf libheif && \ cd .. COPY ./insert ./insert CMD ["insert"] ``` When running make it outputs ``` Scanning dependencies of target doc_doxygen [ 1%] Generating API documentation with Doxygen Warning: ignoring unsupported tag `ALLOW_UNICODE_NAMES =' at line 79, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `OUTPUT_TEXT_DIRECTION =' at line 102, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `JAVADOC_BANNER =' at line 208, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `PYTHON_DOCSTRING =' at line 236, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `OPTIMIZE_OUTPUT_SLICE =' at line 308, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `TOC_INCLUDE_HEADINGS =' at line 350, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `GROUP_NESTED_COMPOUNDS =' at line 407, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `NUM_PROC_THREADS =' at line 474, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `EXTRACT_PRIV_VIRTUAL =' at line 500, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `RESOLVE_UNNAMED_PARAMS =' at line 544, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `HIDE_COMPOUND_REFERENCE=' at line 611, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `SHOW_GROUPED_MEMB_INC =' at line 624, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `WARN_AS_ERROR =' at line 839, file /var/task/libheif/build/Doxyfile Warning: Tag `CLANG_ASSISTED_PARSING' at line 1161 of file /var/task/libheif/build/Doxyfile belongs to an option that was not enabled at compile time. To avoid this warning please remove this line from your configuration file, upgrade it using "doxygen -u", or recompile doxygen with this feature enabled. Warning: ignoring unsupported tag `CLANG_ADD_INC_PATHS =' at line 1167, file /var/task/libheif/build/Doxyfile Warning: Tag `CLANG_OPTIONS' at line 1175 of file /var/task/libheif/build/Doxyfile belongs to an option that was not enabled at compile time. To avoid this warning please remove this line from your configuration file, upgrade it using "doxygen -u", or recompile doxygen with this feature enabled. Warning: ignoring unsupported tag `CLANG_DATABASE_PATH =' at line 1188, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `HTML_DYNAMIC_MENUS =' at line 1346, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `HTML_FORMULA_FORMAT =' at line 1620, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `FORMULA_MACROFILE =' at line 1646, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `LATEX_MAKEINDEX_CMD =' at line 1833, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `LATEX_EXTRA_STYLESHEET =' at line 1900, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `LATEX_TIMESTAMP =' at line 1969, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `LATEX_EMOJI_DIRECTORY =' at line 1977, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `RTF_SOURCE_CODE =' at line 2043, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `MAN_SUBDIR =' at line 2078, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `XML_NS_MEMB_FILE_SCOPE =' at line 2121, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `DOCBOOK_PROGRAMLISTING =' at line 2148, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `DIA_PATH =' at line 2342, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `DOT_UML_DETAILS =' at line 2449, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `DOT_WRAP_THRESHOLD =' at line 2458, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `DIAFILE_DIRS =' at line 2578, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `PLANTUML_JAR_PATH =' at line 2586, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `PLANTUML_CFG_FILE =' at line 2591, file /var/task/libheif/build/Doxyfile Warning: ignoring unsupported tag `PLANTUML_INCLUDE_PATH =' at line 2596, file /var/task/libheif/build/Doxyfile [ 1%] Built target doc_doxygen Scanning dependencies of target heif [ 2%] Building CXX object libheif/CMakeFiles/heif.dir/bitstream.cc.o [ 3%] Building CXX object libheif/CMakeFiles/heif.dir/box.cc.o [ 5%] Building CXX object libheif/CMakeFiles/heif.dir/error.cc.o [ 6%] Building CXX object libheif/CMakeFiles/heif.dir/heif.cc.o [ 7%] Building CXX object libheif/CMakeFiles/heif.dir/context.cc.o [ 9%] Building CXX object libheif/CMakeFiles/heif.dir/file.cc.o [ 10%] Building CXX object libheif/CMakeFiles/heif.dir/pixelimage.cc.o [ 11%] Building CXX object libheif/CMakeFiles/heif.dir/hevc.cc.o [ 13%] Building CXX object libheif/CMakeFiles/heif.dir/avif.cc.o [ 14%] Building CXX object libheif/CMakeFiles/heif.dir/plugin_registry.cc.o [ 15%] Building CXX object libheif/CMakeFiles/heif.dir/heif_plugin.cc.o [ 17%] Building CXX object libheif/CMakeFiles/heif.dir/nclx.cc.o [ 18%] Building CXX object libheif/CMakeFiles/heif.dir/init.cc.o [ 19%] Building CXX object libheif/CMakeFiles/heif.dir/mask_image.cc.o [ 21%] Building CXX object libheif/CMakeFiles/heif.dir/metadata_compression.cc.o [ 22%] Building CXX object libheif/CMakeFiles/heif.dir/common_utils.cc.o [ 23%] Building CXX object libheif/CMakeFiles/heif.dir/region.cc.o [ 25%] Building CXX object libheif/CMakeFiles/heif.dir/heif_regions.cc.o [ 26%] Building CXX object libheif/CMakeFiles/heif.dir/heif_properties.cc.o [ 27%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/colorconversion.cc.o [ 28%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/rgb2yuv.cc.o [ 30%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/rgb2yuv_sharp.cc.o [ 31%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/yuv2rgb.cc.o [ 32%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/rgb2rgb.cc.o [ 34%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/monochrome.cc.o [ 35%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/hdr_sdr.cc.o [ 36%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/alpha.cc.o [ 38%] Building CXX object libheif/CMakeFiles/heif.dir/color-conversion/chroma_sampling.cc.o [ 39%] Building CXX object libheif/CMakeFiles/heif.dir/jpeg.cc.o [ 40%] Building CXX object libheif/CMakeFiles/heif.dir/jpeg2000.cc.o [ 42%] Building CXX object libheif/CMakeFiles/heif.dir/vvc.cc.o /var/task/libheif/libheif/vvc.cc: In member function ‘virtual Error Box_vvcC::parse(BitstreamRange&)’: /var/task/libheif/libheif/vvc.cc:39:39: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion] c.numTemporalLayers = (byte & 0x38) >> 3; ^ /var/task/libheif/libheif/vvc.cc:46:39: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion] c.chroma_format_idc = (byte & 0x60) >> 5; ^ [ 43%] Building CXX object libheif/CMakeFiles/heif.dir/plugins_unix.cc.o [ 44%] Building CXX object libheif/CMakeFiles/heif.dir/plugins/encoder_x265.cc.o [ 46%] Building CXX object libheif/CMakeFiles/heif.dir/plugins/decoder_libde265.cc.o [ 47%] Building CXX object libheif/CMakeFiles/heif.dir/plugins/encoder_mask.cc.o [ 48%] Linking CXX shared library libheif.so [ 48%] Built target heif Scanning dependencies of target heif-info [ 50%] Building CXX object examples/CMakeFiles/heif-info.dir/heif_info.cc.o [ 51%] Building CXX object examples/CMakeFiles/heif-info.dir/common.cc.o [ 52%] Linking CXX executable heif-info [ 52%] Built target heif-info Scanning dependencies of target heif-convert [ 53%] Building CXX object examples/CMakeFiles/heif-convert.dir/encoder.cc.o [ 55%] Building CXX object examples/CMakeFiles/heif-convert.dir/encoder_y4m.cc.o [ 56%] Building CXX object examples/CMakeFiles/heif-convert.dir/heif_convert.cc.o [ 57%] Building CXX object examples/CMakeFiles/heif-convert.dir/__/libheif/exif.cc.o [ 59%] Building CXX object examples/CMakeFiles/heif-convert.dir/common.cc.o [ 60%] Building CXX object examples/CMakeFiles/heif-convert.dir/encoder_jpeg.cc.o [ 61%] Building CXX object examples/CMakeFiles/heif-convert.dir/encoder_png.cc.o /var/task/libheif/examples/encoder_png.cc: In member function ‘virtual bool PngEncoder::Encode(const heif_image_handle*, const heif_image*, const string&)’: /var/task/libheif/examples/encoder_png.cc:156:14: error: ‘png_text’ has no member named ‘itxt_length’ xmp_text.itxt_length = text_length; ^ make[2]: *** [examples/CMakeFiles/heif-convert.dir/encoder_png.cc.o] Error 1 make[1]: *** [examples/CMakeFiles/heif-convert.dir/all] Error 2 make: *** [all] Error 2 ``` Any idea why it acts like this ? Thx
encoder_png.cc error when installing on Dockerfile
https://api.github.com/repos/strukturag/libheif/issues/1020/comments
7
2023-10-31T16:50:55Z
2023-11-08T08:31:24Z
https://github.com/strukturag/libheif/issues/1020
1,970,885,625
1,020
[ "strukturag", "libheif" ]
Hello, Is there a way in the API to take a single input .heif file with multiple AVIF frames and output one .heif-file per frame without re-compressing each frame ?
split multipage
https://api.github.com/repos/strukturag/libheif/issues/1018/comments
2
2023-10-30T15:26:51Z
2024-01-05T10:55:35Z
https://github.com/strukturag/libheif/issues/1018
1,968,644,605
1,018
[ "strukturag", "libheif" ]
I bootstrapped the build with ``` mkdir build cd build cmake .. ``` The cmake check fails with ``` Performing C++ SOURCE FILE Test HAVE_JPEG_WRITE_ICC_PROFILE failed with the following output: Change Dir: /path/to/libheif/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_ebf80/fast" /usr/bin/make -f CMakeFiles/cmTC_ebf80.dir/build.make CMakeFiles/cmTC_ebf80.dir/build make[1]: Verzeichnis »/path/to/libheif/build/CMakeFiles/CMakeTmp« wird betreten Building CXX object CMakeFiles/cmTC_ebf80.dir/src.cxx.o /usr/lib/ccache/c++ -DHAVE_JPEG_WRITE_ICC_PROFILE -fPIE -o CMakeFiles/cmTC_ebf80.dir/src.cxx.o -c /path/to/libheif/build/CMakeFiles/CMakeTmp/src.cxx /path/to/libheif/build/CMakeFiles/CMakeTmp/src.cxx: In function ‘int main()’: /path/to/libheif/build/CMakeFiles/CMakeTmp/src.cxx:7:39: error: ‘jpeg_write_icc_profile’ was not declared in this scope jpeg_write_icc_profile(NULL, NULL, 0); ^ make[1]: *** [CMakeFiles/cmTC_ebf80.dir/src.cxx.o] Fehler 1 make[1]: Verzeichnis »/path/to/libheif/build/CMakeFiles/CMakeTmp« wird verlassen make: *** [cmTC_ebf80/fast] Fehler 2 Source file was: #include <stddef.h> #include <stdio.h> #include <jpeglib.h> int main() { jpeg_write_icc_profile(NULL, NULL, 0); return 0; } ``` The file `/usr/include/jpeglib.h` from `libjpeg-turbo8-dev 2.0.3-0ubuntu1.20.04.3` contains this definition: ``` /* Write ICC profile. See libjpeg.txt for usage information. */ EXTERN(void) jpeg_write_icc_profile(j_compress_ptr cinfo, const JOCTET *icc_data_ptr, unsigned int icc_data_len); ``` Compilation fails with the same error as here: https://github.com/strukturag/libheif/issues/70#issuecomment-419677303
Detection of "jpeg_write_icc_profile" fails on Ubuntu 20.04
https://api.github.com/repos/strukturag/libheif/issues/1016/comments
2
2023-10-30T09:31:54Z
2023-12-20T10:27:02Z
https://github.com/strukturag/libheif/issues/1016
1,967,906,182
1,016
[ "strukturag", "libheif" ]
[crash.zip](https://github.com/strukturag/libheif/files/13198141/crash.zip) The file from archive is causing crash. ``` heif-convert clusterfuzz-testcase-minimized-kimgio_heif_fuzzer-5997988230856704.heic output.png terminate called after throwing an instance of 'std::length_error' what(): cannot create std::vector larger than max_size() Zrušené ```
terminate called after throwing an instance of 'std::length_error'
https://api.github.com/repos/strukturag/libheif/issues/1014/comments
1
2023-10-29T13:11:22Z
2023-10-30T19:54:42Z
https://github.com/strukturag/libheif/issues/1014
1,966,985,324
1,014
[ "strukturag", "libheif" ]
Had to downgrade to 1.17.0 to restore functionality.
1.17.1 breaks darktable from opening HEIF files.
https://api.github.com/repos/strukturag/libheif/issues/1010/comments
18
2023-10-23T23:08:07Z
2023-10-28T04:11:49Z
https://github.com/strukturag/libheif/issues/1010
1,958,175,196
1,010
[ "strukturag", "libheif" ]
``` Run ./scripts/install-ci-linux.sh Removing packages libjpeg.*-dev libpng.*-dev ... Reading package lists... Building dependency tree... Reading state information... Package 'libjpeg7-dev' is not installed, so not removed Package 'libpng12-0-dev' is not installed, so not removed Package 'libpng12-dev' is not installed, so not removed Package 'libpng2-dev' is not installed, so not removed Package 'libpng3-dev' is not installed, so not removed Package 'libpng16-dev' is not installed, so not removed Package 'libpng16-devtools' is not installed, so not removed Package 'libjpeg62-dev' is not installed, so not removed Package 'libjpeg9-dev' is not installed, so not removed Package 'libpng++-dev' is not installed, so not removed Package 'libpnglite-dev' is not installed, so not removed The following packages will be REMOVED: libcairo2-dev libdjvulibre-dev libfontconfig-dev libfontconfig1-dev libfreetype-dev libfreetype6-dev libgdk-pixbuf-2.0-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libmagickcore-6.q16-dev libmagickcore-dev libmagickwand-6.q16-dev libmagickwand-dev libpng-dev librsvg2-dev libtiff-dev libwmf-dev r-base-dev 0 upgraded, 0 newly installed, 19 to remove and 28 not upgraded. After this operation, 24.3 MB disk space will be freed. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 225948 files and directories currently installed.) Removing libmagickwand-dev (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3) ... Removing libmagickwand-6.q16-dev:amd64 (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3) ... Removing libmagickcore-dev (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3) ... Removing libmagickcore-6.q16-dev:amd64 (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.3) ... Removing librsvg2-dev:amd64 (2.52.5+dfsg-3ubuntu0.2) ... Removing libcairo2-dev:amd64 (1.16.0-5ubuntu2) ... Removing libdjvulibre-dev:amd64 (3.5.28-2build2) ... Removing libfontconfig1-dev:amd64 (2.13.1-4.2ubuntu5) ... Removing libfontconfig-dev:amd64 (2.13.1-4.2ubuntu5) ... Removing libfreetype6-dev:amd64 (2.11.1+dfsg-1ubuntu0.2) ... Removing libwmf-dev (0.2.12-5ubuntu1) ... Removing libfreetype-dev:amd64 (2.11.1+dfsg-1ubuntu0.2) ... Removing libgdk-pixbuf-2.0-dev:amd64 (2.42.8+dfsg-1ubuntu0.2) ... Removing r-base-dev (4.3.1-4.2204.0) ... Removing libtiff-dev:amd64 (4.3.0-6ubuntu0.6) ... Removing libjpeg-dev:amd64 (8c-2ubuntu10) ... Removing libjpeg8-dev:amd64 (8c-2ubuntu10) ... Removing libjpeg-turbo8-dev:amd64 (2.1.2-0ubuntu1) ... Removing libpng-dev:amd64 (1.6.37-3build5) ... Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.8+dfsg-1ubuntu0.2) ... Processing triggers for man-db (2.10.2-1) ... Installing emscripten 1.37.40 to /home/runner/work/libheif-web/libheif-web/libheif/scripts/../emscripten ... Cloning SDK base system ... Cloning into 'emsdk'... POST git-upload-pack (175 bytes) POST git-upload-pack (gzip 6967 to 3517 bytes) Updating SDK base to 1.37.40 ... Already on 'main' Your branch is up to date with 'origin/main'. POST git-upload-pack (186 bytes) From https://github.com/emscripten-core/emsdk = [up to date] main -> origin/main = [up to date] 3.1.46-arm64 -> origin/3.1.46-arm64 = [up to date] add_ninja -> origin/add_ninja = [up to date] add_test -> origin/add_test = [up to date] always_embedded -> origin/always_embedded = [up to date] cleanup_fetch_emscripten_tags -> origin/cleanup_fetch_emscripten_tags = [up to date] clone_branch -> origin/clone_branch = [up to date] docker_use_local_emsdk -> origin/docker_use_local_emsdk = [up to date] embedded -> origin/embedded = [up to date] fix_docker -> origin/fix_docker = [up to date] github_actions -> origin/github_actions = [up to date] java_path -> origin/java_path = [up to date] macos_10.12 -> origin/macos_10.12 = [up to date] master -> origin/master = [up to date] no_checkout -> origin/no_checkout = [up to date] os_override -> origin/os_override = [up to date] remove_single_file_tool -> origin/remove_single_file_tool = [up to date] rename_upstream -> origin/rename_upstream = [up to date] seperate_path_env -> origin/seperate_path_env = [up to date] show-activated-paths -> origin/show-activated-paths = [up to date] test -> origin/test = [up to date] test_spaces -> origin/test_spaces = [up to date] trzeci/testing_docker_image -> origin/trzeci/testing_docker_image = [up to date] update_linux_image -> origin/update_linux_image = [up to date] update_min_macos_version -> origin/update_min_macos_version = [up to date] update_tests -> origin/update_tests = [up to date] xcode13 -> origin/xcode13 Already up to date. error: pathspec '1.37.40' did not match any file(s) known to git Error: Process completed with exit code 1. ```
Error: pathspec '1.37.40' did not match any file(s) known to git
https://api.github.com/repos/strukturag/libheif/issues/1009/comments
2
2023-10-22T10:39:07Z
2023-10-22T11:10:50Z
https://github.com/strukturag/libheif/issues/1009
1,955,849,578
1,009
[ "strukturag", "libheif" ]
`[ 97%] Building CXX object libheif/plugins/CMakeFiles/heif-jpegenc.dir/encoder_jpeg.cc.o /home/axel/p/rpm/BUILD/libheif-1.17.1/libheif/plugins/encoder_jpeg.cc: In function 'heif_error jpeg_encode_image(void*, const heif_image*, heif_image_input_class)': /home/axel/p/rpm/BUILD/libheif-1.17.1/libheif/plugins/encoder_jpeg.cc:366:37: error: invalid conversion from 'long unsigned int*' to 'size_t*' {aka 'unsigned int*'} [-fpermissive] 366 | jpeg_mem_dest(&cinfo, &outbuffer, &outlength); | ^~~~~~~~~~ | | | long unsigned int* In file included from /home/axel/p/rpm/BUILD/libheif-1.17.1/libheif/plugins/encoder_jpeg.cc:33: /opt/jpeg/include/jpeglib.h:981:41: note: initializing argument 3 of 'void jpeg_mem_dest(j_compress_ptr, unsigned char**, size_t*)' 981 | size_t * outsize)); | ~~~~~~~~~^~~~~~~ /opt/jpeg/include/jpeglib.h:877:25: note: in definition of macro 'JPP' 877 | #define JPP(arglist) arglist | ^~~~~~~ make[2]: *** [libheif/plugins/CMakeFiles/heif-jpegenc.dir/build.make:76: libheif/plugins/CMakeFiles/heif-jpegenc.dir/encoder_jpeg.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:361: libheif/plugins/CMakeFiles/heif-jpegenc.dir/all] Error 2 make: *** [Makefile:156: all] Error 2 `
1.17.1 32-bit compile fails
https://api.github.com/repos/strukturag/libheif/issues/1008/comments
10
2023-10-22T08:50:43Z
2024-01-03T13:34:45Z
https://github.com/strukturag/libheif/issues/1008
1,955,817,890
1,008
[ "strukturag", "libheif" ]
We have API to get top level images, and anything that is referenced to those images (e.g. regions, metadata, aux images). We don't have the ability to get top level metadata items. The GIMI profile uses that for security markings that apply to the file as a whole. I call that "file level" to distinguish it from image-level metadata items. I have a rough-draft implementation. The current API looks like this: ``` diff --git a/libheif/heif.h b/libheif/heif.h index 0c25f5e..0bfcd02 100644 --- a/libheif/heif.h +++ b/libheif/heif.h @@ -955,6 +955,54 @@ struct heif_error heif_context_get_image_handle(struct heif_context* ctx, heif_item_id id, struct heif_image_handle**); +LIBHEIF_API +int heif_context_get_number_of_file_level_metadata(struct heif_context* ctx); + +// Fills in file level metadata IDs into the user-supplied int-array 'ID_array', +// preallocated with 'count' entries. +// Function returns the total number of IDs filled into the array. +LIBHEIF_API +int heif_context_get_list_of_file_level_metadata_IDs(struct heif_context* ctx, + heif_item_id* ID_array, + int count); + +/** + * Gets the metadata type for a top-level metadata item. + * + * This is the 4CC code (e.g. `mime` or `uri `) for the metadata item. + * + * @param ctx the file context + * @param metadata_id the item identifier for the metadata item + * @return the item type + */ +LIBHEIF_API +const char* heif_context_get_file_level_metadata_type(struct heif_context* ctx, heif_item_id metadata_id); + +/** + * Gets the metadata content_type for a top-level metadata item. + * + * This is the MIME for the metadata item. Only valid if the item type is `mime`. + * + * @param ctx the file context + * @param metadata_id the item identifier for the metadata item + * @return the item content_type + */ +LIBHEIF_API +const char* heif_context_get_file_level_metadata_content_type(struct heif_context* ctx, heif_item_id metadata_id); + + +// Get the size of the raw metadata, as stored in the HEIF file. +LIBHEIF_API +size_t heif_context_get_file_level_metadata_size(struct heif_context* ctx, + heif_item_id metadata_id); + +// 'out_data' must point to a memory area of the size reported by heif_context_get_file_level_metadata_size(). +// The data is returned exactly as stored in the HEIF file. +LIBHEIF_API +struct heif_error heif_context_get_file_level_metadata(struct heif_context* ctx, + heif_item_id metadata_id, + void* out_data); ``` Suggestions and improvements definitely appreciated.
API to get top level (not referenced) metadata items
https://api.github.com/repos/strukturag/libheif/issues/1007/comments
2
2023-10-21T21:20:08Z
2023-12-16T01:49:46Z
https://github.com/strukturag/libheif/issues/1007
1,955,668,884
1,007
[ "strukturag", "libheif" ]
Hello, I am using strict_decoding and I received following report from fuzzer: ``` heif_decode_image error: Invalid input: Unknown NCLX matrix coefficients: Unknown error ================================================================= ==222987==ERROR: LeakSanitizer: detected memory leaks Direct leak of 16 byte(s) in 1 object(s) allocated from: #0 0x576a3d in operator new(unsigned long) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:95:3 #1 0x5942da in heif_image_create libheif/libheif/heif.cc:1085:28 #2 0x6fe473 in convert_libde265_image_to_heif_image libheif/libheif/plugins/decoder_libde265.cc:95:9 #3 0x6fe473 in libde265_v1_decode_image(void*, heif_image**) libheif/libheif/plugins/decoder_libde265.cc:334:13 #4 0x5e08d7 in HeifContext::decode_image_planar(unsigned int, std::__1::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_decoding_options const&, bool) const libheif/libheif/context.cc:1355:11 #5 0x5dd3c6 in HeifContext::decode_image_user(unsigned int, std::__1::shared_ptr<HeifPixelImage>&, heif_colorspace, heif_chroma, heif_decoding_options const&) const libheif/libheif/context.cc:1248:15 #6 0x5938cf in heif_decode_image libheif/libheif/heif.cc:1046:35 #7 0x57f87f in HEIFHandler::ensureDecoder() /src/kimageformats/src/imageformats/heif.cpp:501:11 #8 0x579fc4 in ensureParsed /src/kimageformats/src/imageformats/heif.cpp:410:26 #9 0x579fc4 in HEIFHandler::read(QImage*) /src/kimageformats/src/imageformats/heif.cpp:75:10 #10 0x57935c in LLVMFuzzerTestOneInput /src/kimgio_fuzzer.cc:62:14 #11 0x44aa63 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15 #12 0x4361c2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6 #13 0x43ba6c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9 #14 0x464fa2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 #15 0x7ea6604c2082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/libc-start.c:308:16 ``` I think the problem is here: https://github.com/strukturag/libheif/blob/49bd673c5110ebd56f0067b761489f4a5a75950d/libheif/plugins/decoder_libde265.cc#L341C7-L341C24 I think that HEIF_WARN_OR_FAIL cleanupBlock should probably call `heif_image_release` too.
memory leak when strict_decoding is enabled
https://api.github.com/repos/strukturag/libheif/issues/1006/comments
2
2023-10-20T19:26:38Z
2023-10-24T21:06:59Z
https://github.com/strukturag/libheif/issues/1006
1,954,905,981
1,006
[ "strukturag", "libheif" ]
Subj. Will be good if release will appear. )
Can we get `1.17.1` version release at `ppa:strukturag/libheif`
https://api.github.com/repos/strukturag/libheif/issues/1005/comments
6
2023-10-20T17:27:42Z
2023-11-21T09:32:14Z
https://github.com/strukturag/libheif/issues/1005
1,954,745,944
1,005
[ "strukturag", "libheif" ]
This is work in progress, but ultimatively add ‘taic’ & ‘itai’ boxes which provide support for nano-precision timestamps.
Add `taic`, `itai` timestamp boxes
https://api.github.com/repos/strukturag/libheif/issues/1003/comments
3
2023-10-19T19:53:42Z
2023-11-13T00:06:33Z
https://github.com/strukturag/libheif/issues/1003
1,952,958,660
1,003
[ "strukturag", "libheif" ]
Some applications might want to safe non-standardized data into the HEIF file. To enable this use case, there should be an API function to write (and read) custom data items. a. Adding an optional item_name b. Specifying the construction method (store in mdat or idat) c. An option to associate the item with 0, 1, or multiple other infe items. d. For items of type ‘uri ‘, specify the item_uri_type
Add API to add custom `infe` items
https://api.github.com/repos/strukturag/libheif/issues/1002/comments
15
2023-10-19T19:52:01Z
2023-11-04T05:42:51Z
https://github.com/strukturag/libheif/issues/1002
1,952,956,588
1,002
[ "strukturag", "libheif" ]
Use case: the GIMI profile defines the ‘geo1’ brand. An API function like `heif_context_add_brand()` would be useful to add these by the application when the generated file conforms to this brand.
Add API function to add user-defined minor brand
https://api.github.com/repos/strukturag/libheif/issues/1001/comments
1
2023-10-19T19:50:00Z
2023-11-01T19:01:24Z
https://github.com/strukturag/libheif/issues/1001
1,952,954,035
1,001
[ "strukturag", "libheif" ]
If libde265 support is enabled heif-covert lists ``` HEIC decoders: - libde265 = libde265 HEVC decoder, version 1.0.12 ``` If libde265 and ffmpeg support is enabled heif-covert lists ``` HEIC decoders: - libde265 = libde265 HEVC decoder, version 1.0.12 ``` Only ffmpeg show no decoders available, looks like a bug? Tested on FreeBSD 13.2 and master branch
FFmpeg not listed as available decoder in heif-convert
https://api.github.com/repos/strukturag/libheif/issues/998/comments
10
2023-10-17T17:40:00Z
2024-01-07T10:02:26Z
https://github.com/strukturag/libheif/issues/998
1,947,930,062
998
[ "strukturag", "libheif" ]
Currently do not know to reproduce it with `heif-enc` (I can not find how to save `nclx` profile with it), still searching was what changed in libheif itself related to this. I remember our discussion https://github.com/strukturag/libheif/discussions/931 but there was no talks that some breaking change will appear. I used `heif_image_set_nclx_color_profile` to set profile and set `macOS_compatibility_workaround_no_nclx_profile` to False, but for some reason with last version no NCLX profile get saved. Can someone point me right place what changes was in 1.17.0 to this?
Problem with saving NCLX profile
https://api.github.com/repos/strukturag/libheif/issues/995/comments
7
2023-10-17T08:54:56Z
2023-11-14T12:42:12Z
https://github.com/strukturag/libheif/issues/995
1,946,904,874
995
[ "strukturag", "libheif" ]
When updating **pillow_heif** to libheif with version 1.17.0, the following error appears in tests related to premultiplied-alpha: ```Invalid input: No 'meta' box``` Test consists of opening RGBA image(8,10,12 bit) and resaving it with premultiplied-alpha flag. Error occurring during opening saved image. Was able to replicate with `heif-enc`: `heif-enc --premultiplied-alpha RGBA_8__29x100.png BAD.heic` - output file is not valid(cannot be opened again by libheif). `heif-enc RGBA_8__29x100.png GOOD.heic` - output file is ok. RGBA_8__29x100.png is a usual generated test image, can be found here: [RGBA_8__29x100.png](https://github.com/bigcat88/pillow_heif/blob/master/tests/images/non_heif/RGBA_8__29x100.png)
error when encoding with premultiplied-alpha(1.17.0)
https://api.github.com/repos/strukturag/libheif/issues/993/comments
1
2023-10-17T07:02:36Z
2023-10-17T08:36:30Z
https://github.com/strukturag/libheif/issues/993
1,946,693,323
993
[ "strukturag", "libheif" ]
The change from autotools (libtool in particular) in libheif-1.15.1 to cmake retained the same SONAME of the library (we call it "install_name" on OS X), which seems correct as it appears only ABIs were added rather than removed or changed. But the compatibility_version got decremented (was 17.0.0 now 1.0.0 when I upgrade libheif to 1.17.0). It is not allowed for compatibility_version to be decreased for any specific install_name, or it will cause a runtime failure for any program that was linked against that install_name that had had a higher compatibility_version. Libtool handles all these library versioning details automatically, via `-version-info`, but cmake does not know anything about this. Assuming I am reading the public APIs correctly, that symbols were added but no symbols were removed or changed, it's correct that install_name stays the same, but compatibility_version should be incremented.
Binary-versioning regression
https://api.github.com/repos/strukturag/libheif/issues/992/comments
10
2023-10-16T23:14:34Z
2023-10-19T10:13:46Z
https://github.com/strukturag/libheif/issues/992
1,946,248,193
992
[ "strukturag", "libheif" ]
Maybe I'm missing something but logic seems to be broken? ``` -- Found SvtEnc -- Found SvtEnc: /usr/local/include ... === Summary of compiled codecs === libde265 HEVC decoder : - disabled FFMPEG HEVC decoder (HW acc) : + built-in x265 HEVC encoder : + built-in Kvazaar HEVC encoder : - disabled AOM AV1 decoder : + built-in AOM AV1 encoder : + built-in Dav1d AV1 decoder : + separate plugin SVT AV1 encoder : + separate plugin Rav1e AV1 encoder : - disabled JPEG decoder : + built-in JPEG encoder : + built-in OpenJPEG J2K decoder : + separate plugin OpenJPEG J2K encoder : + separate plugin -- Found LIBSHARPYUV -- Found libsharpyuv: /usr/local/include/webp libsharpyuv: found ... Compiling 'x265' as built-in backend Not compiling 'libde265' backend Compiling 'dav1d' as dynamic plugin Compiling 'aomdec' as built-in backend Compiling 'aomenc' as built-in backend Not compiling 'svtenc' backend Not compiling 'rav1e' backend Compiling 'jpegdec' as built-in backend Compiling 'jpegenc' as built-in backend Compiling 'j2kdec' as dynamic plugin Compiling 'j2kenc' as dynamic plugin Not compiling 'kvazaar' backend Compiling 'ffmpegdec' as built-in backend Compiling in 'libsharpyuv' ``` OS: FreeBSD 13.2 CMake: 3.26.1 SVT-AV1 1.7.0
1.17.0 / master branch: SvtEnc plugin no longer gets compiled
https://api.github.com/repos/strukturag/libheif/issues/991/comments
2
2023-10-16T19:13:10Z
2023-10-16T19:17:53Z
https://github.com/strukturag/libheif/issues/991
1,945,917,221
991
[ "strukturag", "libheif" ]
Trying compile libfeif 1.17.0 with enabled kvazaar but this error appears: ``` make[2]: Leaving directory '/builddir/build/BUILD/libheif-1.17.0/build' DEBUG util.py:442: /builddir/build/BUILD/libheif-1.17.0/libheif/plugins/encoder_kvazaar.cc:368:11: error: no member named 'enable_logging_output' in 'kvz_config' DEBUG util.py:442: 368 | config->enable_logging_output = 0; DEBUG util.py:442: | ~~~~~~ ^ DEBUG util.py:442: 1 error generated. DEBUG util.py:442: make[2]: *** [libheif/CMakeFiles/heif.dir/build.make:611: libheif/CMakeFiles/heif.dir/plugins/encoder_kvazaar.cc.o] Error 1 ``` Full build log: https://file-store.openmandriva.org/api/v1/file_stores/85e82d93f10a1b65ae4e017136003eb4b5ff3060.log?show=true Details: libfeif 1.17.0 kvazaar 2.2.0 OS: OpeMandriva Cooker Linker: LLVM/Clang 17.0.2 + LLD
compile with kvazaar = error: no member named 'enable_logging_output' in 'kvz_config'
https://api.github.com/repos/strukturag/libheif/issues/990/comments
3
2023-10-16T13:50:24Z
2023-10-16T14:39:03Z
https://github.com/strukturag/libheif/issues/990
1,945,268,336
990
[ "strukturag", "libheif" ]
Found this while building on Focal for our PPA (where we only have aom 2.0.0): ``` /build/libheif-1.17.0/libheif/plugins/encoder_aom.cc: In function 'heif_error aom_encode_image(void*, const heif_image*, heif_image_input_class)': /build/libheif-1.17.0/libheif/plugins/encoder_aom.cc:873:27: error: 'AOM_USAGE_GOOD_QUALITY' was not declared in this scope 873 | unsigned int aomUsage = AOM_USAGE_GOOD_QUALITY; | ^~~~~~~~~~~~~~~~~~~~~~ /build/libheif-1.17.0/libheif/plugins/encoder_aom.cc:876:16: error: 'AOM_USAGE_REALTIME' was not declared in this scope 876 | aomUsage = AOM_USAGE_REALTIME; | ^~~~~~~~~~~~~~~~~~ make[3]: Leaving directory '/build/libheif-1.17.0/obj-x86_64-linux-gnu' make[3]: *** [libheif/plugins/CMakeFiles/heif-aomenc.dir/build.make:66: libheif/plugins/CMakeFiles/heif-aomenc.dir/encoder_aom.cc.o] Error 1 ``` As there are already checks for other symbols, e.g. https://github.com/strukturag/libheif/blob/588b096027d620a9b9a617d1111e5a25d02d48e5/libheif/plugins/encoder_aom.cc#L868 these symbols should also be checked, or the `CMakeLists.txt` should enforce the minimum required version of AOM. For now I'll upgrade to 3.3.0 (as with Jammy) in the PPA to be able to continue but this probably should be resolved anyway.
Cmake doesn't fail on unsupported version of AOM (e.g. 1.0.0.errata1-3build1 from Ubuntu Focal)
https://api.github.com/repos/strukturag/libheif/issues/989/comments
7
2023-10-16T09:05:20Z
2023-10-18T09:13:08Z
https://github.com/strukturag/libheif/issues/989
1,944,732,686
989