VIDEO: Fix memory leak in TrueMotion1 header buffer

Cleanup _buf before returning, even if we don't actually decode
This commit is contained in:
richiesams 2013-09-03 18:18:16 -05:00 committed by Matthew Hoops
parent f6b61291a7
commit 9b02777155

View File

@ -400,11 +400,14 @@ void TrueMotion1Decoder::decode16() {
const Graphics::Surface *TrueMotion1Decoder::decodeImage(Common::SeekableReadStream *stream) {
decodeHeader(stream);
if (compressionTypes[_header.compression].algorithm == ALGO_NOP)
if (compressionTypes[_header.compression].algorithm == ALGO_NOP) {
delete[] _buf;
return 0;
}
if (compressionTypes[_header.compression].algorithm == ALGO_RGB24H) {
warning("Unhandled TrueMotion1 24bpp frame");
delete[] _buf;
return 0;
} else
decode16();