vcl/source/filter/GraphicFormatDetector.cxx | 4 ++-- vcl/source/filter/idxf/dxfgrprd.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 829f59de4e44a5a2c9888e7ceef439809808f2c0 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Fri Sep 12 11:12:19 2025 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Fri Sep 12 13:32:19 2025 +0200 Related tdf#168265: ignore more comments line 1) since 999 indicates a comment section, call DXFSkipLine in case of 999 2) let's consider the case the beginning contains more than 1 comment Limit: we only sniff 256 bytes to detect the format so if comments are too long detection won't work Change-Id: I11a01db49d3faad68c7ab134be0f716767583185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190865 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index a8d4858026c5..0b2e5073b508 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -1152,8 +1152,8 @@ bool GraphicFormatDetector::checkDXF() // tdf#168265: pass comment section which begins with 999 // see https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-3F0380A5-1C15-464D-BC66-2C5F094BCFB9 - if (i < 256 - 2 && maFirstBytes[i] == '9' && maFirstBytes[i + 1] == '9' - && maFirstBytes[i + 2] == '9') + while (i < 256 - 2 && maFirstBytes[i] == '9' && maFirstBytes[i + 1] == '9' + && maFirstBytes[i + 2] == '9') { // we're on the 999 line i = i + 3; diff --git a/vcl/source/filter/idxf/dxfgrprd.cxx b/vcl/source/filter/idxf/dxfgrprd.cxx index a2ab23e6867b..bca9aeed63d1 100644 --- a/vcl/source/filter/idxf/dxfgrprd.cxx +++ b/vcl/source/filter/idxf/dxfgrprd.cxx @@ -139,7 +139,7 @@ sal_uInt16 DXFGroupReader::Read() else if (nG< 210) DXFSkipLine(rIS); else if (nG< 240) F = ReadF(); else if (nG<=369) DXFSkipLine(rIS); - else if (nG< 999) DXFSkipLine(rIS); + else if (nG<=999) DXFSkipLine(rIS); else if (nG<1010) ReadS(); else if (nG<1060) F = ReadF(); else if (nG<1072) I = ReadI();