Fix use-after-move in CPDF_RenderStatus::CompositeDIBitmap()
Remove 2 std::move() calls that can potentially result in use-after-move
errors when the operation fails.
Bug: b/325261377
Change-Id: Id63f70980465c927d252ae9970c2a87ef4c259af
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/116611
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Thomas Sepez <tsepez@google.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 0aa97c4..dadfcfc 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1224,7 +1224,7 @@
}
bitmap->MultiplyAlpha(alpha);
}
- if (m_pDevice->SetDIBits(std::move(bitmap), left, top)) {
+ if (m_pDevice->SetDIBits(bitmap, left, top)) {
return;
}
} else {
@@ -1233,7 +1233,7 @@
uint8_t* fill_argb8 = reinterpret_cast<uint8_t*>(&fill_argb);
fill_argb8[3] *= FXSYS_roundf(alpha * 255) / 255;
}
- if (m_pDevice->SetBitMask(std::move(bitmap), left, top, fill_argb)) {
+ if (m_pDevice->SetBitMask(bitmap, left, top, fill_argb)) {
return;
}
}