diff options
author | Vladimir Menshakov | 2009-11-17 21:47:26 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-11-17 21:47:26 +0000 |
commit | f70473e3cd7fa6c5d4691be7bdbd665dfb14e64d (patch) | |
tree | 525c06e09145554308299d539e0f5a91b09a0ad8 /engines | |
parent | 43f23ee523b05d77a61d4a0335edcc89d6ca1229 (diff) | |
download | scummvm-rg350-f70473e3cd7fa6c5d4691be7bdbd665dfb14e64d.tar.gz scummvm-rg350-f70473e3cd7fa6c5d4691be7bdbd665dfb14e64d.tar.bz2 scummvm-rg350-f70473e3cd7fa6c5d4691be7bdbd665dfb14e64d.zip |
guard surface list from the sizes of zero
svn-id: r45961
Diffstat (limited to 'engines')
-rw-r--r-- | engines/teenagent/surface_list.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 2f426d14f8..9157667ba4 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -33,12 +33,15 @@ void SurfaceList::load(Common::SeekableReadStream *stream, Type type, int sub_ha free(); byte fn = stream->readByte(); - if (stream->eos() || fn == 0) + if (stream->eos()) return; debug(0, "loading %u surfaces from list (skip %d)", fn, sub_hack); surfaces_n = fn - sub_hack; + if (surfaces_n == 0) + return; + surfaces = new Surface[surfaces_n]; byte i; |