Index: trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc	(revision 7188)
+++ trunk/MagicSoft/Mars/mpedestal/MPedPhotCam.cc	(revision 7223)
@@ -336,4 +336,7 @@
 Bool_t MPedPhotCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
 {
+    if (idx>=GetSize())
+        return kFALSE;
+
     switch (type)
     {
