hack around OOM problem due to broken pattern code
This commit is contained in:
		
							parent
							
								
									98b2c4784d
								
							
						
					
					
						commit
						8c2804145c
					
				
							
								
								
									
										12
									
								
								pdf.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								pdf.js
									
									
									
									
									
								
							@ -3030,10 +3030,14 @@ var CanvasGraphics = (function() {
 | 
				
			|||||||
            // we want the canvas to be as large as the step size
 | 
					            // we want the canvas to be as large as the step size
 | 
				
			||||||
            var botRight = applyMatrix([x0 + xstep, y0 + ystep], matrix);
 | 
					            var botRight = applyMatrix([x0 + xstep, y0 + ystep], matrix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var tmpCanvas = new this.ScratchCanvas(
 | 
					            var width = botRight[0] - topLeft[0];
 | 
				
			||||||
                Math.ceil(botRight[0] - topLeft[0]),    // width
 | 
					            var height = botRight[1] - topLeft[1];
 | 
				
			||||||
                Math.ceil(botRight[1] - topLeft[1])     // height
 | 
					
 | 
				
			||||||
            );
 | 
					            // TODO: hack to avoid OOM, remove then pattern code is fixed
 | 
				
			||||||
 | 
					            if (Math.abs(width) > 8192 || Math.abs(height) > 8192)
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            var tmpCanvas = new this.ScratchCanvas(width, height);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // set the new canvas element context as the graphics context
 | 
					            // set the new canvas element context as the graphics context
 | 
				
			||||||
            var tmpCtx = tmpCanvas.getContext("2d");
 | 
					            var tmpCtx = tmpCanvas.getContext("2d");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user