mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-12 12:09:15 +00:00
VIDEO: Fix potential memory leak when buffering a QuickTime frame
This commit is contained in:
parent
749cdd6f44
commit
ef098e2898
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user