changeset 5384:3528d151a57e libavformat

Determine VOC block length when length field is zero, fixes issue1538.
author pross
date Tue, 24 Nov 2009 07:08:17 +0000
parents 79b48fe3d753
children de6eb16c2b5b
files voc.h vocdec.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/voc.h	Mon Nov 23 08:47:47 2009 +0000
+++ b/voc.h	Tue Nov 24 07:08:17 2009 +0000
@@ -26,7 +26,7 @@
 #include "riff.h"    /* for CodecTag */
 
 typedef struct voc_dec_context {
-    int remaining_size;
+    int64_t remaining_size;
 } VocDecContext;
 
 typedef enum voc_type {
--- a/vocdec.c	Mon Nov 23 08:47:47 2009 +0000
+++ b/vocdec.c	Tue Nov 24 07:08:17 2009 +0000
@@ -76,6 +76,11 @@
         if (type == VOC_TYPE_EOF)
             return AVERROR(EIO);
         voc->remaining_size = get_le24(pb);
+        if (!voc->remaining_size) {
+            if (url_is_streamed(s->pb))
+                return AVERROR(EIO);
+            voc->remaining_size = url_fsize(pb) - url_ftell(pb);
+        }
         max_size -= 4;
 
         switch (type) {