Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-19 16:34:55 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-19 17:58:30 +0300
commit3e1028c625e11d9d19376f5c88267de1cee8fa70 (patch)
tree687d71ab3c35a2771450ced8c03724dc39c91d5c /libavcodec/flacdsp.h
parente8d4eacc07c61ae24f48451073a2620d8d257d33 (diff)
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.h11
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);