[Mesa-dev] [PATCH v2] postprocess: Check ppq is null before calling pp_free_bos.
Brian Paul
brianp at vmware.com
Mon Aug 5 07:00:25 PDT 2013
On 08/03/2013 12:45 AM, Vinson Lee wrote:
> pp_free_bos dereferences ppq without a null check.
>
> Fixes "Dereference before null check" defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/gallium/auxiliary/postprocess/pp_init.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c
> index 201a357..a49a23d 100644
> --- a/src/gallium/auxiliary/postprocess/pp_init.c
> +++ b/src/gallium/auxiliary/postprocess/pp_init.c
> @@ -169,7 +169,9 @@ pp_free(struct pp_queue_t *ppq)
> {
> unsigned int i, j;
>
> - pp_free_fbos(ppq);
> + if (ppq) {
> + pp_free_fbos(ppq);
> + }
>
> if (ppq && ppq->p) {
> if (ppq->p->pipe && ppq->filters && ppq->shaders) {
>
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list