Loading
Bug 2021788 - Guard against signed long overflow in...
Bug 2021788 - Guard against signed long overflow in WMFVideoMFTManager::CreateBasicVideoFrame(). r=media-playback-reviewers,jolin Guard CreateBasicVideoFrame() against invalid strides by rejecting non-positive values early, widening the y_size and v_size multiplications to int64_t, validating the results fit in uint32_t before narrowing, and casting stride to int64_t before computing halfStride to avoid overflow when stride == INT32_MAX. IMF2DBuffer::Lock2D can return a negative stride for bottom-up images. Multiplying a negative or large LONG stride by the frame height using signed 32-bit arithmetic is undefined behaviour and produces a huge uint32_t offset that is then used to index into the locked IMF buffer, causing an OOB read. Differential Revision: https://phabricator.services.mozilla.com/D288533