diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2010-09-05 21:37:40 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2010-09-05 21:37:40 +0000 |
commit | 4a194c8f4793b094432fc6b33f0fb7a587c3f605 (patch) | |
tree | 2164baf82266b71098853fca22e14fbd86e02b45 /libavformat | |
parent | 8ef38f3f5030a7a1b7eab0a464d7fb36c6dbe565 (diff) | |
download | ffmpeg-4a194c8f4793b094432fc6b33f0fb7a587c3f605.tar.gz |
matroskadec: allow uint and float elements with length = 0
Originally committed as revision 25044 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskadec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 5de60fa18c..888f099ff2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -583,7 +583,7 @@ static int ebml_read_uint(ByteIOContext *pb, int size, uint64_t *num) { 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 *pb, int size, uint64_t *num) */ 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)); |