mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:32:44 +00:00 
			
		
		
		
	LibPDF: Replace two more crashes with messages
This commit is contained in:
		
							parent
							
								
									29c3a9c5f0
								
							
						
					
					
						commit
						ca1a98ba9f
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		|  | @ -555,8 +555,10 @@ RENDERER_HANDLER(set_painting_color_extended) | ||||||
| { | { | ||||||
|     // FIXME: Handle Pattern color spaces
 |     // FIXME: Handle Pattern color spaces
 | ||||||
|     auto last_arg = args.last(); |     auto last_arg = args.last(); | ||||||
|     if (last_arg.has<NonnullRefPtr<Object>>() && last_arg.get<NonnullRefPtr<Object>>()->is<NameObject>()) |     if (last_arg.has<NonnullRefPtr<Object>>() && last_arg.get<NonnullRefPtr<Object>>()->is<NameObject>()) { | ||||||
|         TODO(); |         dbgln("pattern space {}", last_arg.get<NonnullRefPtr<Object>>()->cast<NameObject>()->name()); | ||||||
|  |         return Error::rendering_unsupported_error("Pattern color spaces not yet implemented"); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     state().paint_color = TRY(state().paint_color_space->color(args)); |     state().paint_color = TRY(state().paint_color_space->color(args)); | ||||||
|     return {}; |     return {}; | ||||||
|  | @ -903,6 +905,10 @@ PDFErrorOr<NonnullRefPtr<ColorSpace>> Renderer::get_color_space_from_resources(V | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     auto color_space_resource_dict = TRY(resources->get_dict(m_document, CommonNames::ColorSpace)); |     auto color_space_resource_dict = TRY(resources->get_dict(m_document, CommonNames::ColorSpace)); | ||||||
|  |     if (!color_space_resource_dict->contains(color_space_name)) { | ||||||
|  |         dbgln("missing key {}", color_space_name); | ||||||
|  |         return Error::rendering_unsupported_error("Missing entry for color space name"); | ||||||
|  |     } | ||||||
|     auto color_space_array = TRY(color_space_resource_dict->get_array(m_document, color_space_name)); |     auto color_space_array = TRY(color_space_resource_dict->get_array(m_document, color_space_name)); | ||||||
|     return ColorSpace::create(m_document, color_space_array); |     return ColorSpace::create(m_document, color_space_array); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nico Weber
						Nico Weber