diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2014-02-04 13:24:25 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2014-02-04 13:24:25 +0000 |
commit | 7b380d09824c0753516bd0a40afd421eb0e86c33 (patch) | |
tree | a240af79c3fab3b4b30df55df26a349a10eaebb9 | |
parent | dc33cb1418c5e573d4f4325ae15cfab9eec0a140 (diff) | |
download | netsurf-7b380d09824c0753516bd0a40afd421eb0e86c33.tar.gz netsurf-7b380d09824c0753516bd0a40afd421eb0e86c33.tar.bz2 |
fix sign extension issue on 64bit platforms (coverity 1109898)
-rw-r--r-- | content/mimesniff.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/content/mimesniff.c b/content/mimesniff.c index 5b2c14fb5..e8ebf8770 100644 --- a/content/mimesniff.c +++ b/content/mimesniff.c @@ -155,7 +155,7 @@ static bool mimesniff__has_binary_octets(const uint8_t *data, size_t len) static nserror mimesniff__match_mp4(const uint8_t *data, size_t len, lwc_string **effective_type) { - size_t box_size, i; + uint32_t box_size, i; /* ISO/IEC 14496-12:2008 $4.3 says (effectively): * @@ -204,7 +204,9 @@ static nserror mimesniff__match_mp4(const uint8_t *data, size_t len, /* Search each compatible brand in the box for "mp4" */ for (i = 16; i <= box_size - 4; i += 4) { - if (data[i] == 'm' && data[i+1] == 'p' && data[i+2] == '4') { + if (data[i] == 'm' && + data[i+1] == 'p' && + data[i+2] == '4') { *effective_type = lwc_string_ref(video_mp4); return NSERROR_OK; } |