vlc | branch: master | Hugo Beauzée-Luyssen <[email protected]> | Fri Nov 22 12:28:57 2019 +0100| [882147a6b2134de33cabe07923818b95598fb11a] | committer: Hugo Beauzée-Luyssen
SDL_image: Fix unaligned and potentially out of bound access SDL_image allocates an unpadded buffer of height * pitch, causing the access to the last pixel to be one byte out of bounds > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=882147a6b2134de33cabe07923818b95598fb11a --- modules/codec/sdl_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/codec/sdl_image.c b/modules/codec/sdl_image.c index 013c3fba81..763dddeb2d 100644 --- a/modules/codec/sdl_image.c +++ b/modules/codec/sdl_image.c @@ -223,7 +223,9 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) for ( int j = 0; j < p_surface->w; j++ ) { uint8_t r, g, b; - SDL_GetRGB( *(uint32_t*)p_src, p_surface->format, + uint32_t pixel = 0; + memcpy(&pixel, p_src, 3); + SDL_GetRGB( pixel, p_surface->format, &r, &g, &b ); *(p_dst++) = r; *(p_dst++) = g; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
