diff --git a/src/gfx/pal_spec.cpp b/src/gfx/pal_spec.cpp index 35b65af8..2f53a8fe 100644 --- a/src/gfx/pal_spec.cpp +++ b/src/gfx/pal_spec.cpp @@ -401,6 +401,10 @@ static void parseHEXFile(std::filebuf &file) { if (!readLine(file, line)) { break; } + // Ignore empty lines. + if (line.length() == 0) { + continue; + } if (line.length() != 6 || line.find_first_not_of("0123456789ABCDEFabcdef"sv) != std::string::npos) { diff --git a/test/gfx/empty_lines.flags b/test/gfx/empty_lines.flags new file mode 100644 index 00000000..7b577864 --- /dev/null +++ b/test/gfx/empty_lines.flags @@ -0,0 +1 @@ +-c hex:empty_lines.hex diff --git a/test/gfx/empty_lines.hex b/test/gfx/empty_lines.hex new file mode 100644 index 00000000..29d4022e --- /dev/null +++ b/test/gfx/empty_lines.hex @@ -0,0 +1,7 @@ + +5721d9 + +a9d4fe + + +ffffff diff --git a/test/gfx/empty_lines.png b/test/gfx/empty_lines.png new file mode 100644 index 00000000..57fdd36f Binary files /dev/null and b/test/gfx/empty_lines.png differ