From b9e5b4ebf5e4cbff0f32a193fc2f6051f3ea195c Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Wed, 30 Aug 2006 09:16:40 +0200 Subject: [PATCH] some small bugfixes about image signatures --- images/sig-seg.c | 2 +- images/sig-txt.c | 6 ++++++ images/signature.h | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/images/sig-seg.c b/images/sig-seg.c index dc445bd9..cdcb71c8 100644 --- a/images/sig-seg.c +++ b/images/sig-seg.c @@ -7,7 +7,7 @@ * of the GNU Lesser General Public License. */ -#define LOCAL_DEBUG +#undef LOCAL_DEBUG #include "sherlock/sherlock.h" #include "lib/conf.h" diff --git a/images/sig-txt.c b/images/sig-txt.c index 0429b739..31887cf2 100644 --- a/images/sig-txt.c +++ b/images/sig-txt.c @@ -31,6 +31,12 @@ image_sig_detect_textured(struct image_sig_data *data) uns i, j; u32 cnt[IMAGE_REG_MAX]; + if (cell_cols * cell_rows < 4) + { + DBG("Image is not textured."); + return; + } + DBG("Detecting textured image... cols=%u rows=%u cell_cols=%u cell_rows=%u", cols, rows, cell_cols, cell_rows); /* Compute cells boundaries */ diff --git a/images/signature.h b/images/signature.h index 5f8009a1..4f53f24f 100644 --- a/images/signature.h +++ b/images/signature.h @@ -43,11 +43,11 @@ struct image_cluster { struct { s32 dot; /* Dot product of the splitting plane */ s8 vec[IMAGE_VEC_F]; /* Normal vector of the splitting plane */ - }; + } PACKED; struct { u64 pos; /* Cluster size in bytes */ - }; - }; + } PACKED; + } PACKED; } PACKED; static inline uns -- 2.39.5