vpx_img_set_rect: reject vertically flipped images
Replace the flip-and-restore approach from 01a78fbc3 with an early
failure when the image has negative luma stride. This follows Wan-Teh
Chang's request and leaves the descriptor unchanged on rejection.
Existing rectangle bounds checks remain in place.
Replace the flip/crop commutativity test with ordinary allocated 4x4
images covering rejection, unchanged viewport state, normal cropping,
and cropping after flipping back. Use an even-offset 2x2 crop to make plane
pointer changes observable, snapshot only the used plane pointers, and
check the Y-plane pointer after the final crop. Document the API
restriction.
Discussion: https://chromium-review.googlesource.com/c/webm/libvpx/+/8219547/comment/ea8eaa6a_8fe3b3b2/
Test: five selected VpxImageTest cases pass in a codec-disabled generic
build.
Assisted-by: OpenAI Codex
Change-Id: I344548df2ca31a3b9ae7f6559675002c139aa79d
3 files changed