Fixes bug 308.
Unified · Split
| @@ -71,10 +71,11 @@ static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb, · 70 unmodified lines | ||
| 71 | 71 | { |
| 72 | 72 | char buf[16]; |
| 73 | 73 | |
| 74 | − short current, total; | |
| 74 | + short current, total = 0; | |
| 75 | 75 | avio_rb16(pb); // unknown |
| 76 | 76 | current = avio_rb16(pb); |
| 77 | − total = avio_rb16(pb); | |
| 77 | + if (len >= 6) | |
| 78 | + total = avio_rb16(pb); | |
| 78 | 79 | if (!total) |
| 79 | 80 | snprintf(buf, sizeof(buf), "%d", current); |
| 80 | 81 | else |