After Pdfium commit b2ae83e8a2b0ed945f931338d6aa7e10ebb1fae0 all builds crash when calling PdfiumViewer.PdfDocument.Render. I'm not sure if this is a bug introduced into Pdfium or if can be handled with changes to PdfiumViewer, but I wasn't able to find a work abound other than by excluding this commit from my Pdfium builds. Below is a link to the commit that causes the issues I've experienced as well as some of the exception trace.
I'm also going to post this issue in the Pdfium bug group and request another review of this commit.
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
at PdfiumViewer.NativeMethods.Imports.FPDF_LoadPage(IntPtr document, Int32 page_index)
at PdfiumViewer.NativeMethods.FPDF_LoadPage(IntPtr document, Int32 page_index)
at PdfiumViewer.PdfFile.PageData..ctor(IntPtr document, IntPtr form, Int32 pageNumber)
at PdfiumViewer.PdfFile.GetPageData(Int32 pageNumber)
at PdfiumViewer.PdfFile.RenderPDFPageToBitmap(Int32 pageNumber, IntPtr bitmapHandle, Int32 dpiX, Int32 dpiY, Int32 boundsOriginX, Int32 boundsOriginY, Int32 boundsWidth, Int32 boundsHeight, Int32 rotate, FPDF flags, Boolean renderFormFill)
at PdfiumViewer.PdfDocument.Render(Int32 page, Int32 width, Int32 height, Single dpiX, Single dpiY, PdfRotation rotate, PdfRenderFlags flags)
After Pdfium commit b2ae83e8a2b0ed945f931338d6aa7e10ebb1fae0 all builds crash when calling PdfiumViewer.PdfDocument.Render. I'm not sure if this is a bug introduced into Pdfium or if can be handled with changes to PdfiumViewer, but I wasn't able to find a work abound other than by excluding this commit from my Pdfium builds. Below is a link to the commit that causes the issues I've experienced as well as some of the exception trace.
I'm also going to post this issue in the Pdfium bug group and request another review of this commit.
Thanks, Ryan
https://pdfium.googlesource.com/pdfium/+/b2ae83e8a2b0ed945f931338d6aa7e10ebb1fae0
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' at PdfiumViewer.NativeMethods.Imports.FPDF_LoadPage(IntPtr document, Int32 page_index) at PdfiumViewer.NativeMethods.FPDF_LoadPage(IntPtr document, Int32 page_index) at PdfiumViewer.PdfFile.PageData..ctor(IntPtr document, IntPtr form, Int32 pageNumber) at PdfiumViewer.PdfFile.GetPageData(Int32 pageNumber) at PdfiumViewer.PdfFile.RenderPDFPageToBitmap(Int32 pageNumber, IntPtr bitmapHandle, Int32 dpiX, Int32 dpiY, Int32 boundsOriginX, Int32 boundsOriginY, Int32 boundsWidth, Int32 boundsHeight, Int32 rotate, FPDF flags, Boolean renderFormFill) at PdfiumViewer.PdfDocument.Render(Int32 page, Int32 width, Int32 height, Single dpiX, Single dpiY, PdfRotation rotate, PdfRenderFlags flags)