Mon, 18 Feb 2019 07:48:23 -0800Fixed bug 4500 - Heap-Buffer Overflow in Map1toN pertaining to SDL_pixels.c SDL-1.2
Sam Lantinga <slouken@libsdl.org> [Mon, 18 Feb 2019 07:48:23 -0800] rev 12611
Fixed bug 4500 - Heap-Buffer Overflow in Map1toN pertaining to SDL_pixels.c

Petr Pisar

The reproducer has these data in BITMAPINFOHEADER:

biSize = 40
biBitCount = 8
biClrUsed = 131075

SDL_LoadBMP_RW() function passes biBitCount as a color depth to SDL_CreateRGBSurface(), thus 256-color pallete is allocated. But then biClrUsed colors are read from a file and stored into the palette. SDL_LoadBMP_RW should report an error if biClrUsed is greater than 2^biBitCount.

Sun, 17 Feb 2019 16:20:23 +0100Fix invalid memory access and optimise Blit_3or4_to_3or4__*
Sylvain Becker <sylvain.becker@gmail.com> [Sun, 17 Feb 2019 16:20:23 +0100] rev 12610
Fix invalid memory access and optimise Blit_3or4_to_3or4__*

Fix invalid write at last pixel of the surface:
when surface has no padding (pitch == w * bpp) and bpp is 3
with Blit, no colorkey, and NO_ALPHA same or inverse rgb triplet

Optimise by using int32 access:

BGR24 -> ARGB8888 : faster x1.897875 (362405 -> 190953)
RGB24 -> ABGR8888 : faster x1.660416 (363304 -> 218803)

ABGR8888 -> RGB24 : faster x1.686319 (334962 -> 198635)
ARGB8888 -> BGR24 : faster x1.691868 (324524 -> 191814)
BGR24 -> RGB888 : faster x1.678459 (326811 -> 194709)
BGR888 -> RGB24 : faster x1.731772 (327724 -> 189242)
RGB24 -> BGR888 : faster x1.690989 (328916 -> 194511)
RGB888 -> BGR24 : faster x1.698333 (326175 -> 192056)

Sat, 09 Feb 2019 17:40:32 +0100Better naming for the blit permutation variables
Sylvain Becker <sylvain.becker@gmail.com> [Sat, 09 Feb 2019 17:40:32 +0100] rev 12609
Better naming for the blit permutation variables

Sat, 09 Feb 2019 17:20:53 +0100Faster blit colorkey or not, applied to bpp: 3->4 and 4->3
Sylvain Becker <sylvain.becker@gmail.com> [Sat, 09 Feb 2019 17:20:53 +0100] rev 12608
Faster blit colorkey or not, applied to bpp: 3->4 and 4->3

===== BlitNtoNKey ========
ABGR8888 -> BGR24 : faster x3 (2168709 -> 562738)
ABGR8888 -> RGB24 : faster x3 (2165055 -> 567458)

ARGB8888 -> BGR24 : faster x3 (2169109 -> 564338)
ARGB8888 -> RGB24 : faster x3 (2165266 -> 567081)

BGR24 -> ABGR8888 : faster x3 (2997675 -> 891636)
BGR24 -> ARGB8888 : faster x3 (2985449 -> 892028)
BGR24 -> BGR888 : faster x3 (2961611 -> 891913)
BGR24 -> BGRA8888 : faster x3 (3116305 -> 891534)
BGR24 -> BGRX8888 : faster x3 (3179654 -> 896978)
BGR24 -> RGB888 : faster x3 (2968191 -> 895112)
BGR24 -> RGBA8888 : faster x3 (2998428 -> 893147)
BGR24 -> RGBX8888 : faster x3 (2976529 -> 914853)

BGR888 -> BGR24 : faster x3 (2161906 -> 563921)
BGR888 -> RGB24 : faster x3 (2168228 -> 566634)

BGRA8888 -> BGR24 : faster x4 (2270501 -> 561873)
BGRA8888 -> RGB24 : faster x3 (2163179 -> 567330)

BGRX8888 -> BGR24 : faster x3 (2162911 -> 562322)
BGRX8888 -> RGB24 : faster x3 (2169617 -> 570927)

RGB24 -> ABGR8888 : faster x3 (2977061 -> 925975)
RGB24 -> ARGB8888 : faster x3 (2978148 -> 923680)
RGB24 -> BGR888 : faster x3 (3001413 -> 935074)
RGB24 -> BGRA8888 : faster x3 (2959003 -> 924096)
RGB24 -> BGRX8888 : faster x3 (2965240 -> 927100)
RGB24 -> RGB888 : faster x3 (2983921 -> 926063)
RGB24 -> RGBA8888 : faster x3 (2963908 -> 925457)
RGB24 -> RGBX8888 : faster x3 (2967957 -> 931700)

RGB888 -> BGR24 : faster x3 (2173299 -> 563226)
RGB888 -> RGB24 : faster x3 (2218374 -> 566164)

RGBA8888 -> BGR24 : faster x3 (2166355 -> 561381)
RGBA8888 -> RGB24 : faster x3 (2170322 -> 566729)

RGBX8888 -> BGR24 : faster x3 (2168524 -> 564072)
RGBX8888 -> RGB24 : faster x3 (2163680 -> 566956)

===== BlitNtoN ========

BGR24 -> BGRA8888 : faster x3 (2458958 -> 797557)
BGR24 -> BGRX8888 : faster x3 (2486085 -> 797745)
BGR24 -> RGBA8888 : faster x3 (2422116 -> 797637)
BGR24 -> RGBX8888 : faster x3 (2454426 -> 799085)

BGRA8888 -> BGR24 : faster x4 (2468206 -> 524486)
BGRA8888 -> RGB24 : faster x4 (2463581 -> 525561)

BGRX8888 -> BGR24 : faster x4 (2583355 -> 524468)
BGRX8888 -> RGB24 : faster x4 (2477242 -> 524284)

RGB24 -> BGRA8888 : faster x2 (2453414 -> 818415)
RGB24 -> BGRX8888 : faster x3 (2414915 -> 800863)
RGB24 -> RGBA8888 : faster x3 (2461114 -> 798148)
RGB24 -> RGBX8888 : faster x3 (2400922 -> 799203)

RGBA8888 -> BGR24 : faster x4 (2494472 -> 526428)
RGBA8888 -> RGB24 : faster x4 (2462260 -> 526791)

RGBX8888 -> BGR24 : faster x4 (2541115 -> 524390)
RGBX8888 -> RGB24 : faster x4 (2469059 -> 525416)

Fri, 08 Feb 2019 17:15:30 +0100Fix wrong access and simplify
Sylvain Becker <sylvain.becker@gmail.com> [Fri, 08 Feb 2019 17:15:30 +0100] rev 12607
Fix wrong access and simplify

Thu, 07 Feb 2019 22:45:50 +0100Some simplification of previous commit
Sylvain Becker <sylvain.becker@gmail.com> [Thu, 07 Feb 2019 22:45:50 +0100] rev 12606
Some simplification of previous commit

Thu, 07 Feb 2019 22:03:30 +0100Faster blit with CopyAlpha, no ColorKey
Sylvain Becker <sylvain.becker@gmail.com> [Thu, 07 Feb 2019 22:03:30 +0100] rev 12605
Faster blit with CopyAlpha, no ColorKey
Applied to following formats:

ABGR8888 -> BGRA8888 : faster x3 (2727179 -> 704761)
ABGR8888 -> RGBA8888 : faster x3 (2707808 -> 705309)

ARGB8888 -> BGRA8888 : faster x3 (2745371 -> 712437)
ARGB8888 -> RGBA8888 : faster x3 (2746230 -> 705236)

BGRA8888 -> ABGR8888 : faster x3 (2745026 -> 707045)
BGRA8888 -> ARGB8888 : faster x3 (2752760 -> 727373)
BGRA8888 -> RGBA8888 : faster x3 (2769544 -> 704607)

RGBA8888 -> ABGR8888 : faster x3 (2725058 -> 706669)
RGBA8888 -> ARGB8888 : faster x3 (2704866 -> 707132)
RGBA8888 -> BGRA8888 : faster x3 (2710351 -> 704615)

Thu, 07 Feb 2019 21:49:24 +0100Code factorization of the pixel format permutation
Sylvain Becker <sylvain.becker@gmail.com> [Thu, 07 Feb 2019 21:49:24 +0100] rev 12604
Code factorization of the pixel format permutation

Thu, 07 Feb 2019 18:52:49 +0100Fix wrong comment
Sylvain Becker <sylvain.becker@gmail.com> [Thu, 07 Feb 2019 18:52:49 +0100] rev 12603
Fix wrong comment

Thu, 07 Feb 2019 18:51:14 +0100Faster blit with no ColorKey
Sylvain Becker <sylvain.becker@gmail.com> [Thu, 07 Feb 2019 18:51:14 +0100] rev 12602
Faster blit with no ColorKey
Applied to following formats:

ABGR8888 -> BGRX8888 : faster x5 (3177493 -> 630439)
ABGR8888 -> RGBX8888 : faster x5 (3178104 -> 628925)

ARGB8888 -> BGRX8888 : faster x4 (3141089 -> 629448)
ARGB8888 -> RGBX8888 : faster x5 (3216413 -> 630465)

BGR888 -> BGRA8888 : faster x4 (3145403 -> 637701)
BGR888 -> BGRX8888 : faster x4 (3142106 -> 630144)
BGR888 -> RGBA8888 : faster x4 (3202685 -> 649384)
BGR888 -> RGBX8888 : faster x4 (3170617 -> 658670)

BGRA8888 -> BGR888 : faster x4 (3203308 -> 657697)
BGRA8888 -> RGB888 : faster x5 (3201475 -> 631747)
BGRA8888 -> RGBX8888 : faster x5 (3274544 -> 630409)

BGRX8888 -> ABGR8888 : faster x4 (3149753 -> 638682)
BGRX8888 -> ARGB8888 : faster x5 (3164101 -> 631273)
BGRX8888 -> BGR888 : faster x4 (3144454 -> 630712)
BGRX8888 -> RGB888 : faster x4 (3160490 -> 638047)
BGRX8888 -> RGBA8888 : faster x5 (3308988 -> 631232)
BGRX8888 -> RGBX8888 : faster x5 (3216775 -> 638065)

RGB888 -> BGRA8888 : faster x4 (3143135 -> 655146)
RGB888 -> BGRX8888 : faster x4 (3141790 -> 653771)
RGB888 -> RGBA8888 : faster x5 (3214402 -> 637001)
RGB888 -> RGBX8888 : faster x4 (3143082 -> 630009)

RGBA8888 -> BGR888 : faster x3 (3157048 -> 920375)
RGBA8888 -> BGRX8888 : faster x5 (3196692 -> 632996)
RGBA8888 -> RGB888 : faster x4 (3141570 -> 652151)

RGBX8888 -> ABGR8888 : faster x5 (3175401 -> 631218)
RGBX8888 -> ARGB8888 : faster x4 (3144690 -> 639440)
RGBX8888 -> BGR888 : faster x4 (3144250 -> 630171)
RGBX8888 -> BGRA8888 : faster x5 (3220321 -> 630731)
RGBX8888 -> BGRX8888 : faster x4 (3178453 -> 637445)
RGBX8888 -> RGB888 : faster x5 (3203623 -> 632596)