diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 14:34:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 15:58:30 +0100 |
commit | 3e1028c625e11d9d19376f5c88267de1cee8fa70 (patch) | |
tree | 687d71ab3c35a2771450ced8c03724dc39c91d5c /libavcodec/flacdsp.h | |
parent | e8d4eacc07c61ae24f48451073a2620d8d257d33 (diff) | |
download | ffmpeg-3e1028c625e11d9d19376f5c88267de1cee8fa70.tar.gz |
avcodec/flac: Fix several integer overflows
Fixes: 686513-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/flacdsp.h')
-rw-r--r-- | libavcodec/flacdsp.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/flacdsp.h b/libavcodec/flacdsp.h index f5cbd94724..31417f8414 100644 --- a/libavcodec/flacdsp.h +++ b/libavcodec/flacdsp.h @@ -20,8 +20,19 @@ #define AVCODEC_FLACDSP_H #include <stdint.h> +#include "libavutil/internal.h" #include "libavutil/samplefmt.h" +// For debuging we use signed operations so overflows can be detected (by ubsan) +// For production we use unsigned so there are no undefined operations +#ifdef CHECKED +#define SUINT int +#define SUINT32 int32_t +#else +#define SUINT unsigned +#define SUINT32 uint32_t +#endif + typedef struct FLACDSPContext { void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels, int len, int shift); |