Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Crash when rendering lines with missing patterns #14230

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mbgl/renderer/layers/render_line_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) {
texsize,
crossfade,
parameters.pixelRatio),
*posA,
*posB,
posA,
posB,
Copy link
Contributor Author

@kkaefer kkaefer Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The draw lambda accepts optionals anyway, so no need to dereference them on the way.

LinePatternProgram::TextureBindings{
textures::image::Value{ *geometryTile.iconAtlasTexture->resource, gfx::TextureFilterType::Linear },
});
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/renderer/paint_property_binder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ConstantCrossFadedPaintPropertyBinder final : public PaintPropertyBinder<T
void upload(gfx::Context&) override {}

void setPatternParameters(const optional<ImagePosition>& posA, const optional<ImagePosition>& posB, CrossfadeParameters&) override {
if (!posA && !posB) {
if (!posA || !posB) {
return;
} else {
constantPatternPositions = std::tuple<std::array<uint16_t, 4>, std::array<uint16_t, 4>> { posB->tlbr(), posA->tlbr() };
Expand Down