[FFmpeg-cvslog] r20596 - in trunk/libavformat: voc.h vocdec.c

pross subversion
Tue Nov 24 08:08:18 CET 2009


Author: pross
Date: Tue Nov 24 08:08:17 2009
New Revision: 20596

Log:
Determine VOC block length when length field is zero

Modified:
   trunk/libavformat/voc.h
   trunk/libavformat/vocdec.c

Modified: trunk/libavformat/voc.h
==============================================================================
--- trunk/libavformat/voc.h	Tue Nov 24 07:05:41 2009	(r20595)
+++ trunk/libavformat/voc.h	Tue Nov 24 08:08:17 2009	(r20596)
@@ -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 {

Modified: trunk/libavformat/vocdec.c
==============================================================================
--- trunk/libavformat/vocdec.c	Tue Nov 24 07:05:41 2009	(r20595)
+++ trunk/libavformat/vocdec.c	Tue Nov 24 08:08:17 2009	(r20596)
@@ -76,6 +76,11 @@ voc_get_packet(AVFormatContext *s, AVPac
         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) {



More information about the ffmpeg-cvslog mailing list