r5957 dynis - in /trunk/libnsgif: libnsgif.c libnsgif.h

John Tytgat joty at netsurf-browser.org
Sat Jan 3 13:47:16 GMT 2009


In message <courier.495F0D38.00004765 at atlanta.semichrome.net> you wrote:

> Author: dynis
> Date: Sat Jan  3 01:01:10 2009
> New Revision: 5957
> 
> [...]
> +		/*	Check if the frame data runs off the end of the file
> +		*/
> +		if ((int)(gif_bytes - block_size) < 0) {

Understanding the difference between signed vs unsigned overflow in C is
not always intuitive and obvious so I'm a bit puzzled why we wouldn't go
for the more obvious:

	if (gif_bytes < (unsigned int)block_size) {

with gif_bytes being unsigned and block_size signed.

John.
-- 
John Tytgat
joty at netsurf-browser.org



More information about the netsurf-dev mailing list