diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-12-30 21:48:43 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-12-30 21:49:00 +0100 |
commit | 8b232dc44464a70b53c3b6e1616de21b52e13e67 (patch) | |
tree | 49f8faa40e8e8e0324af2c8e066e84de119527bf | |
parent | fa69935e67ab78e811c21f672d70b1576155eb33 (diff) | |
download | fiv-8b232dc44464a70b53c3b6e1616de21b52e13e67.tar.gz fiv-8b232dc44464a70b53c3b6e1616de21b52e13e67.tar.xz fiv-8b232dc44464a70b53c3b6e1616de21b52e13e67.zip |
Add pointless likelihood macros
-rw-r--r-- | fiv-io.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1004,7 +1004,7 @@ parse_jpeg_metadata(cairo_surface_t *surface, const gchar *data, gsize len) // Do not bother validating the structure. guint16 length = p[0] << 8 | p[1]; const guint8 *payload = p + 2; - if ((p += length) > end) + if (G_UNLIKELY((p += length) > end)) break; // https://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf 4.7.2 @@ -2726,8 +2726,8 @@ fiv_io_exif_orientation(const guint8 *tiff, gsize len) for (const guint8 *p = ifd0 + 2; fields-- && p + 12 <= end; p += 12) { uint16_t tag = u16(p), type = u16(p + 2), value16 = u16(p + 8); uint32_t count = u32(p + 4); - if (tag == Orientation && type == SHORT && count == 1 && - value16 >= 1 && value16 <= 8) + if (G_UNLIKELY(tag == Orientation && type == SHORT && count == 1 && + value16 >= 1 && value16 <= 8)) return value16; } return FivIoOrientationUnknown; |