PdfiumViewer
PdfiumViewer copied to clipboard
Exception when rendering corrupt pages with no height
I've tried to open a PDF document containing a corrupt page with a height of 0. The image renderer throws an exception caused by the invalid value of height. My solution is to set a minimum value to both parameters width and height using Math.Max().
File: PdfDocument.cs Line: 334
var bitmap = new Bitmap(Math.Max(1, width), Math.Max(1, height), PixelFormat.Format32bppArgb);