spv: Fix crash reading a page_setup without headings.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 10 Feb 2023 18:53:06 +0000 (10:53 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 10 Feb 2023 18:57:19 +0000 (10:57 -0800)
The SPV driver can output such a page_setup.

src/output/spv/spv.c

index 38abf9775c87cb93ab5e9d385712c8821612d656..eb4d1cd792daf1f85cc204640a8dd7c8da8071c4 100644 (file)
@@ -321,6 +321,9 @@ decode_page_paragraph (const struct spvsx_page_paragraph *page_paragraph,
 {
   memset (ph, 0, sizeof *ph);
 
+  if (!page_paragraph)
+    return;
+
   const struct spvsx_page_paragraph_text *page_paragraph_text
     = page_paragraph->page_paragraph_text;
   if (!page_paragraph_text)