[PATCH 1/6] ebml.c: fix bad length check.

Reimar Döffinger <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
Fixes trac issue #2361.
---
 libmpdemux/ebml.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libmpdemux/ebml.c b/libmpdemux/ebml.c
index 858811d37..59e2d7299 100644
--- a/libmpdemux/ebml.c
+++ b/libmpdemux/ebml.c
@@ -31,10 +31,6 @@
 #include "libavutil/intfloat.h"


-#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t)-1)
-#endif
-
 /*
  * Read: the element content data ID.
  * Return: the ID.
@@ -214,7 +210,7 @@ char *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)
+    if (len >= INT_MAX)
         return NULL;
     if (length)
         *length = len + l;
--
2.30.0

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.