Fix framebuffer pseudo palette setup#56
Conversation
vcam_fb_setcolreg() writes TRUECOLOR entries through info->pseudo_palette, but vcamfb_init() initializes that pointer to NULL. A colormap update can therefore dereference a NULL pseudo_palette. Add a 16-entry pseudo palette to the framebuffer private data and point info->pseudo_palette to it during initialization. Signed-off-by: Shaoen-Lin <shaoen.lin92@gmail.com>
|
Test case to reproduce: This test verifies that Output before fix: Output after fix: Checked Also ran the coding style check: Output: |
|
Hi @jserv , Sorry for the ping. I have updated this PR with the reproduction steps and testing results. This PR fixes a possible NULL pointer dereference in Could you please take a look when convenient? Thank you! |
Function
vcam_fb_setcolreg()writes TRUECOLOR entries throughinfo->pseudo_palette,butvcamfb_init()initializes that pointer to NULL. A colormap update can therefore dereference a NULLpseudo_palette.Add a 16-entry pseudo palette to the framebuffer private data and point
info->pseudo_paletteto it during initialization.