From 002b88cf581fb91d29865485d7763e9ac635909a Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Sat, 21 Oct 2023 10:52:34 +0200 Subject: [PATCH] decode: improve Invalid preview_size error with to/r13/from_autocad_r13/ROBOT.DWG. check against the obj->size not some hardcoded too low limit. But now this file fail with out of memory on outjson --- src/common_entity_data.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common_entity_data.spec b/src/common_entity_data.spec index 88b094864c..7e0ff67050 100644 --- a/src/common_entity_data.spec +++ b/src/common_entity_data.spec @@ -321,7 +321,7 @@ FIELD_BLL (preview_size, 160); } #endif - if ((long)_ent->preview_size >= 0 && _ent->preview_size < 210210) + if ((long)_ent->preview_size >= 0 && _ent->preview_size < obj->size) { FIELD_BINARY (preview, _ent->preview_size, 310); }