use safe decompression for lzo'd textures to avoid a crash on corrupt textures. The...
authorJonathan Marshall <jmarshall@never.you.mind>
Sun, 6 Jan 2013 02:13:04 +0000 (15:13 +1300)
committerS. Davilla <davilla@4pi.com>
Sun, 6 Jan 2013 13:35:53 +0000 (08:35 -0500)
xbmc/guilib/TextureBundleXBT.cpp

index 9888e09..3e7fc8f 100644 (file)
@@ -220,7 +220,7 @@ bool CTextureBundleXBT::ConvertFrameToTexture(const CStdString& name, CXBTFFrame
       return false;
     }
     lzo_uint s = (lzo_uint)frame.GetUnpackedSize();
-    if (lzo1x_decompress(buffer, (lzo_uint)frame.GetPackedSize(), unpacked, &s, NULL) != LZO_E_OK ||
+    if (lzo1x_decompress_safe(buffer, (lzo_uint)frame.GetPackedSize(), unpacked, &s, NULL) != LZO_E_OK ||
         s != frame.GetUnpackedSize())
     {
       CLog::Log(LOGERROR, "Error loading texture: %s: Decompression error", name.c_str());