Index: MediaPortal/Source/UI/SkinEngine/ContentManagement/AssetCore/TextureAssetCore.cs
===================================================================
--- MediaPortal/Source/UI/SkinEngine/ContentManagement/AssetCore/TextureAssetCore.cs	(revision 3584)
+++ MediaPortal/Source/UI/SkinEngine/ContentManagement/AssetCore/TextureAssetCore.cs	(working copy)
@@ -45,6 +45,8 @@
 
     #region Consts / Enums
 
+    protected const int FAILURE_LIMIT = 3;
+
     protected enum State
     {
       None,
@@ -69,6 +71,7 @@
     protected float _maxU;
     protected int _allocationSize = 0;
     protected State _state = State.None;
+    protected int _failureCount = 0;
 
     protected WebClient _webClient;
     protected FileStream _fileStream;
@@ -174,6 +177,7 @@
     /// </summary>
     public void ClearFailedState()
     {
+      _failureCount = 0;
       _state = State.None;
     }
 
@@ -205,7 +209,7 @@
         if (!Uri.TryCreate(_textureName, UriKind.Absolute, out uri))
         {
           ServiceRegistration.Get<ILogger>().Error("Cannot open texture :{0}", _textureName);
-          _state = State.Failed;
+          SetFailed();
           return;
         }
         else if (uri.IsFile)
@@ -252,7 +256,7 @@
       ImageInformation info;
       _texture = Texture.FromFile(GraphicsDevice.Device, path, _decodeWidth, _decodeHeight, 1, Usage.None, Format.A8R8G8B8,
           Pool.Default, Filter.None, Filter.None, 0, out info);
-      FinalizeAllocation(info.Width, info.Height);
+      FinalizeAllocation(info.Width, info.Height, true);
     }
 
     protected void AllocateFromFileAsync(string path)
@@ -274,7 +278,7 @@
       catch (IOException e)
       {
         ServiceRegistration.Get<ILogger>().Error("Contentmanager: Image '{0}' could not be opened: {1}", e);
-        _state = State.Failed;
+        SetFailed();
         FreeTemporaryResources();
       }
     }
@@ -282,18 +286,34 @@
     protected void AllocateFromInternalDataStream()
     {
       ImageInformation info;
-      _imageDataStream.Seek(0, SeekOrigin.Begin);
-      _texture = Texture.FromStream(GraphicsDevice.Device, _imageDataStream, 0, _decodeWidth, _decodeHeight, 1, 
-          Usage.None, Format.A8R8G8B8, Pool.Default, Filter.None, Filter.None, 0, out info);
-      FinalizeAllocation(info.Width, info.Height);
+      try
+      {
+        _imageDataStream.Seek(0, SeekOrigin.Begin);
+        _texture = Texture.FromStream(GraphicsDevice.Device, _imageDataStream, 0, _decodeWidth, _decodeHeight, 1,
+            Usage.None, Format.A8R8G8B8, Pool.Default, Filter.None, Filter.None, 0, out info);
+        FinalizeAllocation(info.Width, info.Height, false);
+      }
+      catch (Exception e)
+      {
+        ServiceRegistration.Get<ILogger>().Debug("AllocateFromDataStream exception: {0}", e);
+        SetFailed();
+      }
     }
 
     protected void AllocateFromInternalBuffer()
     {
       ImageInformation info;
-      _texture = Texture.FromMemory(GraphicsDevice.Device, _imageBuffer, _decodeWidth, _decodeHeight, 1, Usage.None, Format.A8R8G8B8, 
-        Pool.Default, Filter.None, Filter.None, 0, out info);
-      FinalizeAllocation(info.Width, info.Height);
+      try
+      {
+        _texture = Texture.FromMemory(GraphicsDevice.Device, _imageBuffer, _decodeWidth, _decodeHeight, 1, Usage.None, Format.A8R8G8B8,
+          Pool.Default, Filter.None, Filter.None, 0, out info);
+        FinalizeAllocation(info.Width, info.Height, false);
+      }
+      catch (Exception e)
+      {
+        ServiceRegistration.Get<ILogger>().Debug("AllocateFromInternalBuffer exception: {0}", e);
+        SetFailed();
+      }
     }
 
     protected void AllocateFromWeb(Uri uri)
@@ -311,7 +331,7 @@
       _state = State.LoadingAsync;
     }
 
-    void FinalizeAllocation(int fileWidth, int fileHeight)
+    protected void FinalizeAllocation(int fileWidth, int fileHeight, bool immediatefailure)
     {
       if (_texture != null)
       {
@@ -323,15 +343,27 @@
         _allocationSize = desc.Width * desc.Height * 4;
         AllocationChanged(AllocationSize);
         _state = State.None;
+        _failureCount = 0;
       }
+      else if (immediatefailure)
+        _state = State.Failed;
       else
-        _state = State.Failed;
+        SetFailed();
 
       FreeTemporaryResources();
     }
 
-    void FreeTemporaryResources()
+    protected void SetFailed()
     {
+      ++_failureCount;
+      if (_failureCount >= FAILURE_LIMIT)
+        _state = State.Failed;
+      else
+        _state = State.None;
+    }
+
+    protected void FreeTemporaryResources()
+    {
       if (_fileStream != null)
         _fileStream.Dispose();
       _fileStream = null;
@@ -357,7 +389,7 @@
       if (e.Error != null)
       {
         ServiceRegistration.Get<ILogger>().Error("Contentmanager: Failed to download {0} - {1}", _textureName, e.Error.Message);
-        _state = State.Failed;
+        SetFailed();
         return;
       }
       // Store image data for allocation later
@@ -391,7 +423,7 @@
 
     public bool IsAllocated
     {
-      get { return (_texture != null); }
+      get { return _texture != null; }
     }
 
     public int AllocationSize
@@ -403,13 +435,11 @@
     {
       if (_texture != null)
       {
-        lock (_texture)
-        {
-          AllocationChanged(-AllocationSize);
-          _texture.Dispose();
-          _texture = null;
-        }
+        AllocationChanged(-AllocationSize);
+        _texture.Dispose();
       }
+      _texture = null;
+      ClearFailedState();
       FreeTemporaryResources();
     }
 
