diff options
Diffstat (limited to 'video/qt_decoder.cpp')
-rw-r--r-- | video/qt_decoder.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 9e26e96c7b..7539d4a1e2 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -712,14 +712,18 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::bufferNextFrame() uint32 descId; Common::SeekableReadStream *frameData = getNextFramePacket(descId); - if (!frameData || !descId || descId > _parent->sampleDescs.size()) + if (!frameData || !descId || descId > _parent->sampleDescs.size()) { + delete frameData; return 0; + } // Find which video description entry we want VideoSampleDesc *entry = (VideoSampleDesc *)_parent->sampleDescs[descId - 1]; - if (!entry->_videoCodec) + if (!entry->_videoCodec) { + delete frameData; return 0; + } const Graphics::Surface *frame = entry->_videoCodec->decodeImage(frameData); delete frameData; |