From 4068f324aea149aae164e65424bc65e78166ecf5 Mon Sep 17 00:00:00 2001 From: Elaine Wang Date: Thu, 31 Jan 2013 22:52:13 +0800 Subject: [PATCH] Fix va_fool.c klocwork issue BZ: 83882 Fix klocwork issue that complaine array 'fool_context[idx].fool_buf' of size 43 may use index value(s) 0..255 Change-Id: I196a36c0067e2b7e390567a203ef1520af5b873f Signed-off-by: Elaine Wang --- va/va_fool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/va/va_fool.c b/va/va_fool.c index 3c7161b..c6b24ee 100644 --- a/va/va_fool.c +++ b/va/va_fool.c @@ -340,7 +340,7 @@ VAStatus va_FoolMapBuffer( unsigned int magic = buf_id & FOOL_BUFID_MASK; DPY2INDEX(dpy); - if (magic != FOOL_BUFID_MAGIC) + if (magic != FOOL_BUFID_MAGIC || buftype >= VABufferTypeMax || !pbuf) return 0; /* buf_id is the buffer type */ -- 2.7.4