NVIDIA / VisRTX

NVIDIA OptiX based implementation of ANARI
Other
239 stars 25 forks source link

Possible bug in renderer initialization code #82

Closed stukowski closed 1 week ago

stukowski commented 2 weeks ago

I came across this code in Frame.cu:

    OPTIX_CHECK(optixLaunch(m_renderer->pipeline(),
        state.stream,
        (CUdeviceptr)deviceData(),
        payloadBytes(),
        m_renderer->sbt(),
        checkerboarding() ? (hd.fb.size.x + 1) / 2 : hd.fb.size.x,
        checkerboarding() ? (hd.fb.size.y + 1) / 2 : hd.fb.size.y,
        1));

I'm not sure, but it looks like m_renderer->pipeline() may return a null pointer, because the pipeline is created only after m_renderer->sbt() is called for the first time.

jeffamstutz commented 1 week ago

While I haven't seen this create issues, it certainly looks like UB. I've fixed this in bc33718, thanks!