Opened 2 years ago
Closed 2 years ago
#9945 closed defect (fixed)
undefined behavior at libavcodec/jpeg2000dwt.c:84:18
Reported by: | Johannes Kauffmann | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | j2k ubsan |
Cc: | Johannes Kauffmann | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
UBSan complains about undefined behaviour when running make check
How to reproduce:
mkdir build && cd build ../configure --toolchain=gcc-usan --enable-debug=2 --disable-stripping --disable-doc UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 make -j8 check
... which prints:
Test j2k-dwt failed. Look at tests/data/fate/j2k-dwt.err for details. make: *** [/home/user/ffmpeg/tests/Makefile:307: fate-j2k-dwt] Error 1 make: *** Waiting for unfinished jobs....
j2k-dwt.err
contains:
src/libavcodec/jpeg2000dwt.c:84:18: runtime error: left shift of negative value -66 #0 0x55863fe454bd in ff_dwt_encode.cold (/home/user/ffmpeg/build/libavcodec/tests/jpeg2000dwt+0x144bd) #1 0x55863fe5a046 in test_dwt src/libavcodec/tests/jpeg2000dwt.c:44 #2 0x55863fe465f0 in main src/libavcodec/tests/jpeg2000dwt.c:134 #3 0x7fd8ddf2fd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #4 0x7fd8ddf2fe3f in __libc_start_main_impl ../csu/libc-start.c:392 #5 0x55863fe48204 in _start (/home/user/ffmpeg/build/libavcodec/tests/jpeg2000dwt+0x17204)
Tested with:
ffmpeg git dd2ea014ef273157fe9a0e928e77841fbbee9b2f
GCC 11.2.0
Ubuntu 22.04.
Change History (4)
comment:1 by , 2 years ago
Keywords: | j2k added; jpeg2000dwt removed |
---|
comment:3 by , 2 years ago
I will just live it here: https://groups.google.com/a/isocpp.org/g/std-proposals/c/UorPkl3Lx1U
This whole undefined in standard, but gcc does not agree for 2's complement is kinda crazy.
Do not we require 2's complement... But on the other hand those are always fixed by mkver:
comment:4 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in fff010591b35874b4c7a7e9fe00d7541f0b7c994.
Note:
See TracTickets
for help on using tickets.