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>
This commit is contained in:
Carl Eugen Hoyos 2011-11-17 14:12:34 +01:00 committed by Anton Khirnov
parent 19ad567311
commit fbcaceb1ff
1 changed files with 3 additions and 2 deletions

View File

@ -71,9 +71,10 @@ static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb,
{ {
char buf[16]; char buf[16];
short current, total; short current, total = 0;
avio_rb16(pb); // unknown avio_rb16(pb); // unknown
current = avio_rb16(pb); current = avio_rb16(pb);
if (len >= 6)
total = avio_rb16(pb); total = avio_rb16(pb);
if (!total) if (!total)
snprintf(buf, sizeof(buf), "%d", current); snprintf(buf, sizeof(buf), "%d", current);