changeset 1845:a77451bb6614

Improve GunPaint format probing.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Jun 2018 21:47:31 +0300
parents 821b8755fcbd
children 88cef7758303
files tools/lib64fmts.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Fri Jun 22 21:47:10 2018 +0300
+++ b/tools/lib64fmts.c	Fri Jun 22 21:47:31 2018 +0300
@@ -285,7 +285,7 @@
 
 static int fmtProbeGunPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
 {
-    if (buf->len > 0x400 &&
+    if (buf->len > fmtGunPaintMagicOffs + fmtGunPaintMagicLen &&
         dmCompareAddr16(buf, 0, fmt->addr) &&
         memcmp(buf->data + fmtGunPaintMagicOffs + 2, fmtGunPaintMagicID, fmtGunPaintMagicLen) == 0)
         return DM_PROBE_SCORE_MAX;