kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

SIGILL when trying to use `-s 0` or `-Q 0` #72

Closed vi closed 1 year ago

vi commented 1 year ago

When using https://github.com/kornelski/cavif-rs/releases/download/v1.5.1/cavif_1.5.1_amd64.deb :

$ cavif -Q 0 q.png
Illegal instruction
$ cavif -s 0 q.png
Illegal instruction

Works in other modes like -Q 1 or -s 1 or default settings.

model name      : Intel(R) Core(TM) i7-9850H CPU
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
kornelski commented 1 year ago

It's hitting:

'assertion failed: quality >= 1. && quality <= 100.', src/main.rs:182:14

but in release mode I compiled it to abort instead of printing assertion errors.

vi commented 1 year ago

speed must be in 1-10 range

If conflicts the help message:

$ cavif --help | rg speed
    -s, --speed <n>        Encoding speed from 0 (best) to 10 (fast but ugly) [default: 4]

1-10 range from 0 (best)

kornelski commented 1 year ago

I've fixed that too