diff options
author | Max Kellermann <max@duempel.org> | 2009-10-11 23:25:27 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-11 23:25:27 +0200 |
commit | 71f881d5cb40fbb77a77a8b50b8d662acaa84310 (patch) | |
tree | ad441b0b2281d155895e6884084c2909ad2ade7c /src/riff.c | |
parent | d4e3fb433064afe5c680019532f376bc1493636f (diff) | |
parent | 9a3f5ff977951781453fbe1e597dbd6eb5f7494a (diff) | |
download | mpd-71f881d5cb40fbb77a77a8b50b8d662acaa84310.tar.gz mpd-71f881d5cb40fbb77a77a8b50b8d662acaa84310.tar.xz mpd-71f881d5cb40fbb77a77a8b50b8d662acaa84310.zip |
Merge branch 'v0.15.x'
Conflicts:
NEWS
configure.ac
Diffstat (limited to '')
-rw-r--r-- | src/riff.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/riff.c b/src/riff.c index 7227fd3c8..a8ea9dd42 100644 --- a/src/riff.c +++ b/src/riff.c @@ -83,6 +83,11 @@ riff_seek_id3(FILE *file) return 0; size = GUINT32_FROM_LE(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; @@ -91,11 +96,6 @@ riff_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; |