When using the PDFium library built for Linux-musl-arm64 in a HarmonyOS mobile application, the following code snippet:
FPDF_DEST dest = FPDFBookmark_GetDest(doc, bookmark);
if (dest) {
int destPageIdx = FPDFDest_GetDestPageIndex(doc, dest);
if (destPageIdx >= 0) {
return static_cast(destPageIdx);
}
}
causes the application to crash. Specifically, after recursively invoking FPDFBookmark_GetDest and FPDFDest_GetDestPageIndex more than eight times, a crash occurs due to null pointer dereference or invalid (wild) pointer access.