Skip to content

Commit

Permalink
Fix crash on unsupported attribute type conversion (#3066)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimSylvester authored Dec 4, 2024
1 parent 61d385b commit 112edb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mbgl/gl/upload_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ gfx::AttributeBindingArray UploadPass::buildAttributeBindings(
return;
}

overrideAttr->setDirty(false);
if (overrideAttr) {
overrideAttr->setDirty(false);
}

bindings[index] = {
/*.attribute = */ {defaultAttr.getDataType(), offset},
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/gl/vertex_attribute_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const std::vector<std::uint8_t>& VertexAttributeGL::getRaw(gfx::VertexAttribute&
for (std::size_t i = 0; i < count; ++i) {
if (!get(attr.get(i), type, outPtr)) {
// missing type conversion
assert(false);
std::fill(outPtr, outPtr + stride_, 0);
}
outPtr += stride_;
}
Expand Down

0 comments on commit 112edb6

Please sign in to comment.