aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/vocdec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2009-11-24 07:08:17 +0000
committerPeter Ross <pross@xvid.org>2009-11-24 07:08:17 +0000
commitc351524c9e7f90be8e11eccc7bac405505e4bb76 (patch)
treebf00179aca987ba068359b97398981b6fcbc693b /libavformat/vocdec.c
parentd90aeeaf569e4a08c30b3d1d09c3cff3a86eb431 (diff)
downloadffmpeg-c351524c9e7f90be8e11eccc7bac405505e4bb76.tar.gz
Determine VOC block length when length field is zero, fixes issue1538.
Originally committed as revision 20596 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/vocdec.c')
-rw-r--r--libavformat/vocdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c
index 94fbd7b9bf..246dbd91b4 100644
--- a/libavformat/vocdec.c
+++ b/libavformat/vocdec.c
@@ -76,6 +76,11 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
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) {