summaryrefslogtreecommitdiffstats
path: root/libmpdemux/ebml.c
diff options
context:
space:
mode:
authorrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-04 22:41:27 +0000
committerrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-06-04 22:41:27 +0000
commit9da93175794398fefeb45c6c53abdcdeda325101 (patch)
tree1dad782a7785b845d9bfc950631e91c01369154b /libmpdemux/ebml.c
parentb4ddc383ef4e4d537417999e390ab90631e7b6aa (diff)
downloadmpv-9da93175794398fefeb45c6c53abdcdeda325101.tar.bz2
mpv-9da93175794398fefeb45c6c53abdcdeda325101.tar.xz
Fix potential integer overflows in memory allocation.
Patch by Rich and me git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18559 b3059339-0415-0410-9bf9-f77b7e298cf2
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;