summaryrefslogtreecommitdiff
path: root/libavcodec/internal.h
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2012-01-12 11:12:24 -0800
committerAlex Converse <alex.converse@gmail.com>2012-01-12 13:26:13 -0800
commit4df30f71147b7bedd4457bcfa0e4efe01085af9f (patch)
treea6fec3f3b2deab2e07269d0b6ca21bd8e11be485 /libavcodec/internal.h
parent81dc6a2a3cefc1f1bbbc249052b3374e524d1ea0 (diff)
utils: Check for extradata size overflows.
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r--libavcodec/internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index b5a04546f3..1c2d0daaef 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -94,4 +94,11 @@ unsigned int avpriv_toupper4(unsigned int x);
int avpriv_lock_avformat(void);
int avpriv_unlock_avformat(void);
+/**
+ * Maximum size in bytes of extradata.
+ * This value was chosen such that every bit of the buffer is
+ * addressable by a 32-bit signed integer as used by get_bits.
+ */
+#define FF_MAX_EXTRADATA_SIZE ((1 << 28) - FF_INPUT_BUFFER_PADDING_SIZE)
+
#endif /* AVCODEC_INTERNAL_H */