From e5615d3a9b013efef5a76a92eb398b331370bae4 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 13 Jul 2010 19:28:07 +0100 Subject: [PATCH] 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 8bccab4604..378ff4a915 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);