summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-11-17 14:12:34 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-11-17 14:12:34 +0100
commitd50122eafaa0cc70d6186c3c106c47ed0b3490d9 (patch)
tree4bcd3827c97eb616c09f42bf03228a01c0db0fcb /libavformat
parent7cdfce4f63f432264c51d25db455278fef692f2c (diff)
Do not try to read total disc or track number if data atom is too short.
Fixes ticket #659.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 668ff89b4f..e940427685 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -87,10 +87,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