changeset 6461:c12416642843 libavformat

matroskadec: allow uint and float elements with length = 0
author aurel
date Sun, 05 Sep 2010 21:37:40 +0000
parents e29a553aa1fc
children 22cb1e82d915
files matroskadec.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Fri Sep 03 20:06:01 2010 +0000
+++ b/matroskadec.c	Sun Sep 05 21:37:40 2010 +0000
@@ -583,7 +583,7 @@
 {
     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_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));