From 00e8004042af0a7a51482d4b35e887f3d6c4e009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 28 Aug 2023 20:14:30 +0200 Subject: [PATCH] Improve GHP data detection Do not consider all files with size divisible by 20 as valid GHP data... Require at least on valid data point. --- src/data/onmoveparsers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/onmoveparsers.cpp b/src/data/onmoveparsers.cpp index 0f7d93eb..3127a8c7 100644 --- a/src/data/onmoveparsers.cpp +++ b/src/data/onmoveparsers.cpp @@ -270,6 +270,10 @@ bool GHPParser::parse(QFile *file, QList &tracks, _errorString = "unexpected end of file"; return false; } + if (!segment.size()) { + _errorString = "No usable data found"; + return false; + } tracks.append(TrackData()); tracks.last().append(segment);