We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3324 - SDL_RenderReadPixels: Wrong rect coordinates with software renderer
Summary: SDL_RenderReadPixels: Wrong rect coordinates with software renderer
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: 2.0.4
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-08 21:24 UTC by Daniel
Modified: 2017-08-11 18:54 UTC (History)
0 users

See Also:


Attachments
Patch (905 bytes, patch)
2017-04-26 14:17 UTC, Daniel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2016-05-08 21:24:07 UTC
SDL_RenderReadPixels with SDL_RENDERER_SOFTWARE reads pixels from wrong coordinates.

SW_RenderReadPixels adjusts the rect coordinates according to the viewport. But since this is already done by SDL_RenderReadPixels, the final rect has x2 bigger X and Y.
Comment 1 Daniel 2017-04-26 14:17:46 UTC
Created attachment 2726 [details]
Patch

Here is a patch to fix the bug.
Comment 2 Sam Lantinga 2017-08-11 18:54:37 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/62db9336e07b