public int getFrameDurationMs(int frameNumber) {
    if (!mDecoded) {
      throw new IllegalStateException("getFrameDurationMs called before decode");
    }

    // For frame number higher than frame count, returning 1 ms ensures that animation backend can
    // fetch loop duration of a frame correctly in case when some frames do not have correct delay.
    if (frameNumber >= getFrameCount()) {
      return 1;
    }

    return mFrameControls.get(frameNumber)[CONTROL_INDEX_DELAY];
  }
@param is InputStream to decode
@param os OutputStream to write fixed version of gif, if needed. (optional)
animated-gif-lite/src/main/java/com/facebook/animated/giflite/decoder/GifMetadataDecoder.java