summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-11-17 14:12:34 +0100
committerAnton Khirnov <anton@khirnov.net>2012-06-26 13:12:50 +0200
commitfbcaceb1ff797245240ec58ee9cac44a90b8f73a (patch)
tree8ef6ba72f2a998a7168c07fd7e9804429489f047 /libavformat/mov.c
parent19ad567311b29a42e308317b5329218c590afac8 (diff)
mov: do not try to read total disc/track number if data atom is too short.
Fixes bug 308. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index fa70eff66f..63254012fc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -71,10 +71,11 @@ static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb,
{
char buf[16];
- short current, total;
+ short current, total = 0;
avio_rb16(pb); // unknown
current = avio_rb16(pb);
- total = avio_rb16(pb);
+ if (len >= 6)
+ total = avio_rb16(pb);
if (!total)
snprintf(buf, sizeof(buf), "%d", current);
else