[Mesa-dev] [PATCH] st/mesa: Initialize tex_target otherwise it might be used uninitialized.

Brian Paul brian.e.paul at gmail.com
Fri Feb 9 14:48:40 UTC 2018


On Fri, Feb 9, 2018 at 3:10 AM, Michel Dänzer <michel at daenzer.net> wrote:

> On 2018-02-09 08:54 AM, Gert Wollny wrote:
> > The initialization of tex_target was dropped and since the value
> > is used uninitialized (e.g. with Unreal Editor), an assertion
> > fires in tgsi/tgsi_util.c:502: tgsi_util_get_texture_coord_dim:
> >   Assertion `!"unknown texture target"' failed.
> >
> > Initialize tex_target with the enum that corresponds to the value 0 used
> > before.
> >
> > Fixes 9f9ce1625fb32ff0b9d5b1858aa5bb7b531ded0f
> >    st/mesa: use TGSI enum types in st_glsl_to_tgsi.cpp
> >
> > Signed-off-by: Gert Wollny <gw.fossdev at gmail.com>
> > ---
> >  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> > index 39a81fad62..1f87591893 100644
> > --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> > +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> > @@ -5863,7 +5863,7 @@ compile_tgsi_instruction(struct st_translate *t,
> >
> >     int num_dst;
> >     int num_src;
> > -   enum tgsi_texture_type tex_target;
> > +   enum tgsi_texture_type tex_target = TGSI_TEXTURE_BUFFER;
> >
> >     num_dst = num_inst_dst_regs(inst);
> >     num_src = num_inst_src_regs(inst);
> >
>
> I wrote the same patch yesterday and pushed it this morning:
> https://patchwork.freedesktop.org/patch/203519/
>
>
> Sorry about that.  Thanks, Michel.

Reviewed-by: Brian Paul <brianp at vmware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180209/1c345883/attachment-0001.html>


More information about the mesa-dev mailing list