The current code has a bug where it will populate the offset of the last frame in the alpha track as opposed to the first. Since the current code loops over all the chunk_offsets, the last value populated for the track would be the offset of the last frame.
If that last frame is not a key frame (likely the case for most practical AVIF sequences), then this would erroneously trigger a "Missing sequence header in mdat box" error.
This PR ensures that the sequence header check is performed only for the first frame in the alpha track.
Also, fix a typo in the variable name "Aplha" => "Alpha".
The current code has a bug where it will populate the offset of the last frame in the alpha track as opposed to the first. Since the current code loops over all the chunk_offsets, the last value populated for the track would be the offset of the last frame.
If that last frame is not a key frame (likely the case for most practical AVIF sequences), then this would erroneously trigger a "Missing sequence header in mdat box" error.
This PR ensures that the sequence header check is performed only for the first frame in the alpha track.
Also, fix a typo in the variable name "Aplha" => "Alpha".