private void newScanOrImageEndFound(int offset) {
    if (mNextFullScanNumber > 0) {
      mBestScanEndOffset = offset;
    }
    mBestScanNumber = mNextFullScanNumber++;
  }
Not every marker is followed by associated segment
imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/ProgressiveJpegParser.java