Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when rendering shaded plots with no data point [v0.16] #536

Open
Nahor opened this issue Nov 22, 2023 · 1 comment
Open

Crash when rendering shaded plots with no data point [v0.16] #536

Nahor opened this issue Nov 22, 2023 · 1 comment

Comments

@Nahor
Copy link

Nahor commented Nov 22, 2023

Implot v0.16 causes a crash when displaying a shaded plot with no data points.

For instance, in the "Demo_ShadedPlots" sample, change line 379 from:

ImPlot::PlotShaded("Uncertain Data",xs,ys1,ys2,1001);

to

ImPlot::PlotShaded("Uncertain Data",xs,ys1,ys2,0);

Then run the application, open the implot demo window and expand the "Shaded plots" section => crash.

When doing the same thing with the line plots (e.g. line 380) instead, there is no crash.

Stracktrace in VS2022:

app.exe!ImPlot::IndexData<float>(const float * data, int idx, int count, int offset, int stride) Line 495
app.exe!ImPlot::IndexerIdx<float>::operator()<int>(int idx) Line 512
app.exe!ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>::operator()<int>(int idx) Line 562
app.exe!ImPlot::RendererShaded<ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>>::Render(ImDrawList & draw_list, const ImRect & cull_rect, int prim) Line 1282
app.exe!ImPlot::RenderPrimitivesEx<ImPlot::RendererShaded<ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>>>(const ImPlot::RendererShaded<ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>> & renderer, ImDrawList & draw_list, const ImRect & cull_rect) Line 1391
app.exe!ImPlot::RenderPrimitives2<ImPlot::RendererShaded,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,unsigned int>(const ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>> & getter1, const ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>> & getter2, unsigned int <args_0>) Line 1411
app.exe!ImPlot::PlotShadedEx<ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>,ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>>>(const char * label_id, const ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>> & getter1, const ImPlot::GetterXY<ImPlot::IndexerIdx<float>,ImPlot::IndexerIdx<float>> & getter2, int flags) Line 1754
app.exe!ImPlot::PlotShaded<float>(const char * label_id, const float * xs, const float * ys1, const float * ys2, int count, int flags, int offset, int stride) Line 1786
app.exe!ImPlot::Demo_ShadedPlots() Line 380
app.exe!ImPlot::DemoHeader(const char * label, void(*)() demo) Line 2143
app.exe!ImPlot::ShowDemoWindow(bool * p_open) Line 2206
[...]
@kingpeterking
Copy link

Yep got the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants