[PATCH fbdev] Fix shadow fb allocation size

Alex Deucher alexdeucher at gmail.com
Tue Jan 3 21:33:29 UTC 2017


On Tue, Jan 3, 2017 at 4:25 PM, Adam Jackson <ajax at redhat.com> wrote:
> ->bitsPerPixel is rather obviously eight times too large.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/fbdev.c b/src/fbdev.c
> index 2c658fe..dbc09bf 100644
> --- a/src/fbdev.c
> +++ b/src/fbdev.c
> @@ -828,7 +828,7 @@ FBDevScreenInit(SCREEN_INIT_ARGS_DECL)
>
>         if (fPtr->shadowFB) {
>             fPtr->shadow = calloc(1, pScrn->virtualX * pScrn->virtualY *
> -                                 pScrn->bitsPerPixel);
> +                                 ((pScrn->bitsPerPixel + 7) / 8));
>
>             if (!fPtr->shadow) {
>                 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> --
> 2.9.3
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list