[FFmpeg-cvslog] r25044 - trunk/libavformat/matroskadec.c

aurel subversion
Sun Sep 5 23:37:40 CEST 2010


Author: aurel
Date: Sun Sep  5 23:37:40 2010
New Revision: 25044

Log:
matroskadec: allow uint and float elements with length = 0

Modified:
   trunk/libavformat/matroskadec.c

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	Sun Sep  5 23:04:11 2010	(r25043)
+++ trunk/libavformat/matroskadec.c	Sun Sep  5 23:37:40 2010	(r25044)
@@ -583,7 +583,7 @@ static int ebml_read_uint(ByteIOContext 
 {
     int n = 0;
 
-    if (size < 1 || size > 8)
+    if (size > 8)
         return AVERROR_INVALIDDATA;
 
     /* big-endian ordering; build up number */
@@ -600,7 +600,9 @@ static int ebml_read_uint(ByteIOContext 
  */
 static int ebml_read_float(ByteIOContext *pb, int size, double *num)
 {
-    if (size == 4) {
+    if (size == 0) {
+        *num = 0;
+    } else if (size == 4) {
         *num= av_int2flt(get_be32(pb));
     } else if(size==8){
         *num= av_int2dbl(get_be64(pb));



More information about the ffmpeg-cvslog mailing list