Security Exception when calling Get/Read Pixels

PROBLEM
When I try and call get pixels/read pixels to take a screenshot of my game it fails with this exception

SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization
UnityEngine.Texture2D.ReadPixels (Rect source, Int32 destX, Int32 destY)

DETAILS of how things are setup

  1. I run my game from some domain (myotherdomain.com/game.unity3d).

  2. Textures are downloaded from Amazon S3 bucket, example the URL looks like this:

http://mybucketname.s3.amazonaws.com/image.png

  1. Cross domain policy stored in ROOT of amazon bucket

http://mybucketname.s3.amazonaws.com/crossdomain.xml

  1. Contents of cross domain look like this (I’ve actually tried many permutations of this - this is what it is currently):

SUGGESTIONS?
What am I doing wrong?

UPDATE
It turns out that there was no security expection after all - well, Unity was throwing this error - but it was due to calling ReadPixels without waiting for the end of frame in my coroutine. I added the following line before readPixels

yield return new WaitForEndOfFrame

And it worked! The security exception went away. So, I’m guessing this is a bug inside of Unity. Appreciate all the help.

Usually the best way to debug crossdomain issues is to start using wireshark and check whether the crossdomain request was successful or not. If it was, so in other words when it could be successfully loaded by Unity, it has to be something wrong with the file itself.

Also the file should be an “ASCII file” like stated in the docs, so check your encoding when saving the file.