From 1a1d42db8382c806cbb9c00f0c1c2250cab795e9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 Jul 2010 19:28:07 +0100 Subject: discard an object media update message if it tries to set more media textures than the prim has faces --- OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 8bccab4..378ff4a 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -227,6 +227,14 @@ namespace OpenSim.Region.CoreModules.Media.Moap // m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); // } + if (omu.FaceMedia.Length > part.GetNumberOfSides()) + { + m_log.WarnFormat( + "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", + omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); + return string.Empty; + } + part.Shape.Media = new List(omu.FaceMedia); UpdateMediaUrl(part); -- cgit v1.1