Skip to content

fix: colored_contours PDF runtime crash - End of record error in pdf_write_color #317

@krystophny

Description

@krystophny

Issue

GitHub Pages deployment is failing because the colored_contours example crashes with:

At line 69 of file ././src/fortplot_pdf_drawing.f90
Fortran runtime error: End of record

Stack Trace

The crash occurs in:

  1. pdf_write_color at line 69 in fortplot_pdf_drawing.f90
  2. set_generic_vector_color at line 130 in fortplot_vector.f90
  3. set_pdf_color at line 107 in fortplot_pdf.f90
  4. During default_gaussian_example PDF rendering

Root Cause

The format string '(F0.3,1X,F0.3,1X,F0.3," RG")' in pdf_write_color is failing, likely due to:

  • Invalid RGB values (NaN, infinity, negative, or out-of-range)
  • Invalid color mapping during filled contour rendering

Impact

🚨 CRITICAL: Blocks GitHub Pages deployment and visual showcase restoration

Solution

Add input validation to pdf_write_color to handle invalid RGB values gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions