AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.58k stars 205 forks source link

Segfault on example #386

Closed vladbondarenko closed 4 years ago

vladbondarenko commented 4 years ago

Hi,

Trying to run example avif_example1.c but faced Segmantation Fault:

Steps to introduce: 1) git clone repo 2) mkdir build && cd build && cmake PATH_to_clone 3) make && make install (also with ldconfig) 4) cd ../examples 5) gcc avif_example1.c -lavif 6) ./a.out: avif version: 0.8.2 Segmentation fault

cmake version 3.16.3 Debian10,Ubuntu16,AmazonLinux1 and AmazonLinux2 are segfaulting.

Any ideas?

joedrago commented 4 years ago

It doesn't appear that you're enabling any AV1 codecs via CMake, so you're very likely dying somewhere in the encoding steps. If you have libaom available on your system (say), you'd add -DAVIF_CODEC_AOM=1 to your cmake commandline.

The examples need a bit of refactoring, and one of those updates can include protecting against running a libavif that wasn't compiled against any encoders/decoders, but this simple example assumes you are capable of both encoding and decoding.

vladbondarenko commented 4 years ago

Thats it, thanks!