Inside GIFImageDecoder::Decode(), if this current frame is empty and it depends on a prior frame, we always call Decode(some_prior_frame). We even call it if the prior frame is already complete.
Inside Decode(), we won't exit early if the frame is already complete. So we'll end up always calling codec_->incrementalDecode().
This seems a bit wrong.
Suppose we are decoding frame 6 and the prior frame can be any of 3, 4, or 5. We could potentially provide frame 4. But the last startIncrementalDecode() may have been for frame 5. So when we call incrementalDecode(), we're really working on frame 5 even though the |index| param here would have been 4.
This seems to not be a huge problem because we don't decode a frame until it is complete. But that is not the case in the unit tests. And because this detail is so subtle I think we should just address it.
Comment 1 by cblume@chromium.org
, Oct 11 2017