summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2010-08-17 14:05:23 +0000
committerAurelien Jacobs <aurel@gnuage.org>2010-08-17 14:05:23 +0000
commit4f90688b6e1d79d85ac2e065a2cf1e7e9bd665a7 (patch)
treebd08b42867700ea4e30666bf33371e1fdf727da0
parentaa78a6d657ec180e013facacb708fd7fc2d4d25e (diff)
matroskadec: fix integer overflow
patch from reimar Originally committed as revision 24803 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroskadec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 60f03ce362..ab5e1d13cf 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -901,6 +901,9 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
int result = 0;
int olen;
+ if (pkt_size >= 10000000)
+ return -1;
+
switch (encodings[0].compression.algo) {
case MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP:
return encodings[0].compression.settings.size;