title: E/libEGL: cache file failed CRC check
body: <p>In my application there is MainActivity contains many buttons clicking on which another activity is created with the image. Click on the image is a simple animation zoom. And there is a problem: two images of all at the frequent click crash activity (not app)  with error </p>
  
  <pre><code>E/libEGL: cache file failed CRC check
  </code></pre>
  
  <p>I compared all the images, they are all approximately the same size and resolution. They are all jpg format. But error raise only two. Also the error does not happen on all physical devices (I tested three) but only on xiaomi redmi note 2</p>
  
  <p>I googled this error and found this:</p>
  
  <pre><code>// Check the file magic and CRC
      size_t cacheSize = fileSize - headerSize;
      if (memcmp(buf, cacheFileMagic, 4) != 0) {
          ALOGE("cache file has bad mojo");
          close(fd);
          return;
      }
      uint32_t* crc = reinterpret_cast&lt;uint32_t*&gt;(buf + 4);
      if (crc32c(buf + headerSize, cacheSize) != *crc) {
          ALOGE("cache file failed CRC check");
          close(fd);
          return;
      }
  </code></pre>
  
  <p><a href="https://android.googlesource.com/platform/frameworks/native/+/jb-dev/opengl/libs/EGL/egl_cache.cpp" rel="noreferrer">From openGL lib EGL</a></p>
  
  <p>What this error means and how to fight it?</p>