diff options
author | Bastien Bouclet | 2017-08-18 09:32:24 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-09-21 13:06:18 +0200 |
commit | 8547c89b86f0be02c4b3ef8e8adb4d5f96cf8432 (patch) | |
tree | dbe3fe398731a85a2d33440888613d87317397d8 /audio | |
parent | 9127f5245fe10bc9de8efea5a9050d980f3ef241 (diff) | |
download | scummvm-rg350-8547c89b86f0be02c4b3ef8e8adb4d5f96cf8432.tar.gz scummvm-rg350-8547c89b86f0be02c4b3ef8e8adb4d5f96cf8432.tar.bz2 scummvm-rg350-8547c89b86f0be02c4b3ef8e8adb4d5f96cf8432.zip |
VIDEO: Change QT edit list to a Common::Array
And fix an out of bounds acces when seeking to the end of a video.
Skipping samples is needed even when seeking through silent edits
because a silent stream is queued for those.
Fixes #10219.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decoders/quicktime.cpp | 9 | ||||
-rw-r--r-- | audio/midiparser_qt.cpp | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index ff87e7a9f8..b8eccb664b 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -299,7 +299,7 @@ int QuickTimeAudioDecoder::QuickTimeAudioTrack::readBuffer(int16 *buffer, const } bool QuickTimeAudioDecoder::QuickTimeAudioTrack::allDataRead() const { - return _curEdit == _parentTrack->editCount; + return _curEdit == _parentTrack->editList.size(); } bool QuickTimeAudioDecoder::QuickTimeAudioTrack::endOfData() const { @@ -314,7 +314,7 @@ bool QuickTimeAudioDecoder::QuickTimeAudioTrack::seek(const Timestamp &where) { if (where >= getLength()) { // We're done - _curEdit = _parentTrack->editCount; + _curEdit = _parentTrack->editList.size(); return true; } @@ -324,8 +324,7 @@ bool QuickTimeAudioDecoder::QuickTimeAudioTrack::seek(const Timestamp &where) { // Now queue up some audio and skip whatever we need to skip Timestamp samplesToSkip = where.convertToFramerate(getRate()) - getCurrentTrackTime(); queueAudio(); - if (_parentTrack->editList[_curEdit].mediaTime != -1) - skipSamples(samplesToSkip, _queue); + skipSamples(samplesToSkip, _queue); return true; } @@ -427,7 +426,7 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::findEdit(const Timestamp &posit // as the position is >= to the edit's start time, it is considered to be in that // edit. seek() already figured out if we reached the last edit, so we don't need // to handle that case here. - for (_curEdit = 0; _curEdit < _parentTrack->editCount - 1; _curEdit++) { + for (_curEdit = 0; _curEdit < _parentTrack->editList.size() - 1; _curEdit++) { Timestamp nextEditTime(0, _parentTrack->editList[_curEdit + 1].timeOffset, _decoder->_timeScale); if (position < nextEditTime) break; diff --git a/audio/midiparser_qt.cpp b/audio/midiparser_qt.cpp index b97ea56df5..3078be9186 100644 --- a/audio/midiparser_qt.cpp +++ b/audio/midiparser_qt.cpp @@ -423,7 +423,7 @@ void MidiParser_QT::initFromContainerTracks() { if (tracks[i]->codecType == CODEC_TYPE_MIDI) { assert(tracks[i]->sampleDescs.size() == 1); - if (tracks[i]->editCount != 1) + if (tracks[i]->editList.size() != 1) warning("Unhandled QuickTime MIDI edit lists, things may go awry"); MIDITrackInfo trackInfo; |