[Piglit] [PATCH] getteximage-formats: Ensure texel is initialized.

Brian Paul brian.e.paul at gmail.com
Sun Dec 9 14:04:33 PST 2012


On Sat, Dec 8, 2012 at 11:15 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes uninitialized scalar variable defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/texturing/getteximage-formats.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/texturing/getteximage-formats.c b/tests/texturing/getteximage-formats.c
> index 2901ec9..c053b7c 100644
> --- a/tests/texturing/getteximage-formats.c
> +++ b/tests/texturing/getteximage-formats.c
> @@ -272,6 +272,12 @@ compute_expected_color(const struct format_desc *fmt,
>                                 texel[2] = 0.0;
>                                 texel[3] = 1.0;
>                         }
> +               } else {
> +                       assert(0);
> +                       texel[0] = 0.0;
> +                       texel[1] = 0.0;
> +                       texel[2] = 0.0;
> +                       texel[3] = 0.0;
>                 }
>
>                 (void) baseFormat;  /* not used, at this time */

One nit: instead of assert(0) let's try to use something more helpful
like assert(!"unexpected texture component sizes").  Similarly for one
of the previous patches you just posted.

Looks good otherwise.

For all six: Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the Piglit mailing list