From 3e1028c625e11d9d19376f5c88267de1cee8fa70 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 19 Feb 2017 14:34:55 +0100 Subject: avcodec/flac: Fix several integer overflows Fixes: 686513-media Found-by: Matt Wolenetz Signed-off-by: Michael Niedermayer --- libavcodec/flacdsp.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libavcodec/flacdsp.h') 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 +#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); -- cgit v1.2.3