LibPDF: Show a 'rendering unsupported' error for images with /Mask key

This commit is contained in:
Nico Weber 2023-11-16 08:58:38 -05:00 committed by Andreas Kling
parent 7d2172ff3d
commit 4bd11c8eb4
Notes: sideshowbarker 2024-07-17 00:59:43 +09:00
2 changed files with 8 additions and 0 deletions

View File

@ -122,6 +122,7 @@
X(Limits) \
X(Linearized) \
X(ML) \
X(Mask) \
X(Matrix) \
X(MediaBox) \
X(MissingWidth) \

View File

@ -1198,6 +1198,13 @@ PDFErrorOr<void> Renderer::show_image(NonnullRefPtr<StreamObject> image)
image_bitmap->set_pixel(i, j, image_color);
}
}
} else if (image_dict->contains(CommonNames::Mask)) {
auto mask_object = TRY(image_dict->get_object(m_document, CommonNames::Mask));
if (mask_object->is<StreamObject>()) {
return Error::rendering_unsupported_error("/Mask stream objects not yet implemented");
} else if (mask_object->is<ArrayObject>()) {
return Error::rendering_unsupported_error("/Mask array objects not yet implemented");
}
}
auto image_space = calculate_image_space_transformation(width, height);