You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: All, All
Comments on the original bug report:
On 2017-11-17 06:05:25 +0000, wrote:
Here is the bug in latest SDL 2.0.8 development repo. It is obvious and simple to fix by correcting typos on six lines of code.
In “src/video/SDL_yuv.c,” on lines 217, 249, 280, 321, 353, and 384 the wrong conversion functions are called for SDL_PIXELFORMAT_ABGR8888 and SDL_PIXELFORMAT_BGR888. Instead of ABGR functions, BGRA functions are called. These are typos.
One example in context:
(…)
line 312:
case SDL_PIXELFORMAT_BGRX8888:
case SDL_PIXELFORMAT_BGRA8888:
yuv420_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_RGB888:
case SDL_PIXELFORMAT_ARGB8888:
yuv420_argb_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
case SDL_PIXELFORMAT_BGR888:
case SDL_PIXELFORMAT_ABGR8888:
yuv420_bgra_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
return SDL_TRUE;
Notice the second to last line, line 321 has a typo. it should read
line321:
yuv420_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
Similarly for line 353, it should read
line353:
yuv422_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
Similarly for line 383, it should read
line383:
yuvnv12_abgr_std(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
And the same typo is also present in the SSE function calls:
line217 should read:
yuv420_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
line249 should read:
yuv422_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
line 280 should read:
yuvnv12_abgr_sseu(width, height, y, u, v, y_stride, uv_stride, rgb, rgb_stride, yuv_type);
In summary, in six places in src/video/SDL_yuv.c, “bgra” should be switched to “abgr”.
It is clear from the context that it is a bug: Why would BGRA and ABGR pixel formats use the same conversion function?
But of course I also double-checked it using a program that displayed the wrong colors when linked to latest 2.0.8 HG but worked fine in previous versions. And indeed, these changes fixed the output. SDL was simply calling the wrong conversion function due to these typos.
On 2017-11-17 18:45:25 +0000, wrote:
Created attachment 3088
proposed patch to fix bug 3964 by fixing the typos in src/video/SDL_yuv.c
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Reported in version: HG 2.0
Reported for operating system, platform: All, All
Comments on the original bug report:
On 2017-11-17 06:05:25 +0000, wrote:
On 2017-11-17 18:45:25 +0000, wrote:
On 2017-11-17 19:03:02 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: