aboutsummaryrefslogtreecommitdiffstats
path: root/src/aiff.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/aiff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/aiff.c b/src/aiff.c
index f77e86d2b..d4bec628b 100644
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -84,6 +84,11 @@ aiff_seek_id3(FILE *file)
return 0;
size = GUINT32_FROM_BE(chunk.size);
+ if (size > G_MAXINT32)
+ /* too dangerous, bail out: possible integer
+ underflow when casting to off_t */
+ return 0;
+
if (size % 2 != 0)
/* pad byte */
++size;
@@ -92,11 +97,6 @@ aiff_seek_id3(FILE *file)
/* found it! */
return size;
- if ((off_t)size < 0)
- /* integer underflow after cast to signed
- type */
- return 0;
-
ret = fseek(file, size, SEEK_CUR);
if (ret != 0)
return 0;