summaryrefslogtreecommitdiffstats
path: root/libmpdemux/ebml.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/ebml.c')
-rw-r--r--libmpdemux/ebml.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmpdemux/ebml.c b/libmpdemux/ebml.c
index 2e5d5a8164..1482cb2754 100644
--- a/libmpdemux/ebml.c
+++ b/libmpdemux/ebml.c
@@ -221,6 +221,8 @@ ebml_read_ascii (stream_t *s, uint64_t *length)
len = ebml_read_length (s, &l);
if (len == EBML_UINT_INVALID)
return NULL;
+ if (len > SIZE_MAX - 1)
+ return NULL;
if (length)
*length = len + l;