mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:52:45 +00:00 
			
		
		
		
	LibGfx: Teach all image decoders to fail on bitmap allocation failure
We don't need to wait for oss-fuzz to find this for us. :^)
This commit is contained in:
		
							parent
							
								
									71d92cef17
								
							
						
					
					
						commit
						c7d0c2ee7a
					
				
					 7 changed files with 27 additions and 2 deletions
				
			
		|  | @ -266,6 +266,10 @@ static bool read_image_data(PBMLoadingContext& context, Streamer& streamer) | |||
|     } | ||||
| 
 | ||||
|     context.bitmap = Bitmap::create_purgeable(BitmapFormat::RGB32, { context.width, context.height }); | ||||
|     if (!context.bitmap) { | ||||
|         context.state = PBMLoadingContext::State::Error; | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     size_t index = 0; | ||||
|     for (int y = 0; y < context.height; ++y) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling