Les articles publiés sur le site
-
30 août 2015, par Erik de Castro Lopo
libFLAC/bitwriter.c: Fix undefined behaviour
- [DH] src/libFLAC/bitwriter.c
-
28 août 2015, par Erik de Castro Lopo
libFLAC/fixed.c: Fix undefined behaviour
Left shift if a negative integer such that the sign bit is affected is
(according to the C spec) undefined behaviour and the residual
calculations using the shift operator were hitting this.
Fortunately these same calculations using plain multiplication do not
invoke UB and according to benchmarking (on x86_64 linux) have the same
performance as the bit shift version.
-
27 août 2015, par Erik de Castro Lopo
tests: Fix undefined behaviour
Undefined behaviour in the test support code.
- [DH] src/test_libFLAC/md5.c
- [DH] src/test_libs_common/metadata_utils.c
-
26 août 2015, par Erik de Castro Lopo
libFLAC/format.c: Fix undefined behaviour
In the case where seek_table->num_points is zero, seek_table->points
will be NULL and passing that to qsort() invokes undefined behaviour.
Since seek_table->num_points is zero, the only sensible thing to do
is to short circuit return 0.
- [DH] src/libFLAC/format.c
-
24 août 2015, par Erik de Castro Lopo
libFLAC/stream_decoder.c: Fix undefined behaviour
Found by compiling with -fsanitize=undefined and running the testsuite.
- [DH] src/libFLAC/stream_decoder.c