title: Android sprite animation with BitmapRegionDecoder
body: <p>I'd like to animate a sprite.
  I select the current frame by BitmapRegionDecoder, but it causes native crash on some Anroid 6.0 devices (mainly on Samsung).
  I get this stack trace: </p>
  
  <blockquote>
    <hr>
    
    <p>Build fingerprint: 'samsung/zeroltexx/zerolte:6.0.1/MMB29K/G925FXXU4DPGW:user/release-keys'
    Revision: '10'
    ABI: 'arm64'
    pid: 10872, tid: 10872, name: .aff.index.main  >>> com.aff.index.main &lt;&lt;&lt;
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x30
        x0   0000000000000000  x1   0000000000000000  x2   0000000000000002  x3   0000000000000000
        x4   0000000000000000  x5   00000000ffffffff  x6   0000000000000000  x7   0000000000000000
        x8   0000000000000000  x9   0000000000000000  x10  0000000000000000  x11  0000000000000000
        x12  0000007f1d0fd5c8  x13  0000000000000002  x14  0000000000000000  x15  000000c8000000c5
        x16  0000007f7931c5f8  x17  0000007f7925e3dc  x18  0000000000000000  x19  0000000000000000
        x20  0000007f7563d180  x21  0000000000000001  x22  0000000000000000  x23  0000000000000000
        x24  0000000000000000  x25  0000000000000000  x26  00000000ffffffff  x27  0000000000000000
        x28  0000000000000000  x29  0000007fead6d070  x30  0000007f79264348
        sp   0000007fead6d050  pc   0000007f7925e3dc  pstate 
    backtrace:
        #00 pc 00000000000f23dc  /system/lib64/libandroid_runtime.so (_ZNK7android6Bitmap4infoEv)
        #01 pc 00000000000f8344  /system/lib64/libandroid_runtime.so (_ZN11GraphicsJNI12createBitmapEP7_JNIEnvPN7android6BitmapEiP11_jbyteArrayP8_jobjecti+60)
        #02 pc 0000000000104224  /system/lib64/libandroid_runtime.so
        #03 pc 0000000003f6b77c  /system/framework/arm64/boot.oat (offset 0x2f37000)</p>
  </blockquote>
  
  <p>I call this runnable inside a View</p>
  
  <pre><code>   @Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      try {
          if (isInited &amp;&amp; region != null) canvas.drawBitmap(region, 0, 0, paint);
      } catch (Throwable t) {
          Timber.w(t, null);
      }
  }
  
  class AnimatePlaceholderRunnable implements Runnable {
      @Override
      public void run() {
          try {
              if (Build.VERSION.SDK_INT &lt; 10) return;
              if (!isAnimating) return;
              if ((top + height + empty) &lt;= maxTop) top = top + height + empty;
              else
                  top = 0;
              bottom = top + height;
              src = new Rect(left, top, right, bottom);
              region = decoder.decodeRegion(src, null);
              invalidate();
              postDelayed(placeholderRunnable, 41);
          } catch (Throwable t) {
              Timber.w(t, null);
          }
      }
  }
  </code></pre>
  
  <p>On many devices it runs well, e.g. on Nexus 6.0 with Android 7.0 or on a Sony XPeria Z1 with Android 5.x, but on my Samsung Galaxy S6 with Android 6.x my app crashes.</p>