We call this function to get us the index of the highest keyframe that is <= the target pts:
https://github.com/pytorch/torchcodec/blob/59af4b77120e53c4fb8cf32e1c459ff5c3a10f12/src/torchcodec/decoders/_core/VideoDecoder.cpp#L698-L699
However this can return -1 if we are trying to seek to some negative value before the first keyframe's pts, and that would be invalid memory.
i.e. desiredKeyFrameIndex could be -1.
We probably should have an std::max(desiredKeyFrameIndex, 0) before looking up the desiredPts.