Skip to content

Commit 4310af5

Browse files
committed
maybe fix a crash seen in crash reports
1 parent 106dcd2 commit 4310af5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/EnginePdf.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,12 @@ RectF EnginePdf::PageMediabox(int pageNo) {
12171217

12181218
RectF EnginePdf::PageContentBox(int pageNo, RenderTarget target) {
12191219
FzPageInfo* pageInfo = GetFzPageInfo(pageNo, false);
1220+
if (!pageInfo) {
1221+
// maybe should return a dummy size. not sure how this
1222+
// will play with layout. The page should fail to render
1223+
// since the doc is broken and page is missing
1224+
return RectF();
1225+
}
12201226

12211227
ScopedCritSec scope(ctxAccess);
12221228

0 commit comments

Comments
 (0)