[MPlayer-cvslog] r38220 - trunk/libmpdemux/ebml.c

reimar subversion at mplayerhq.hu
Wed Jan 20 20:03:29 EET 2021


Author: reimar
Date: Wed Jan 20 20:03:29 2021
New Revision: 38220

Log:
ebml.c: fix bad length check.

Fixes trac issue #2361.

Modified:
   trunk/libmpdemux/ebml.c

Modified: trunk/libmpdemux/ebml.c
==============================================================================
--- trunk/libmpdemux/ebml.c	Wed Jan 20 20:03:28 2021	(r38219)
+++ trunk/libmpdemux/ebml.c	Wed Jan 20 20:03:29 2021	(r38220)
@@ -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, uint6
     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;


More information about the MPlayer-cvslog mailing list