Fix several potential overflow issues identified by the community.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1114 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
@@ -513,6 +513,8 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
|
||||
}
|
||||
}
|
||||
|
||||
if (total == 0)
|
||||
return;
|
||||
cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);
|
||||
cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);
|
||||
cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);
|
||||
|
||||
Reference in New Issue
Block a user