forked from len0rd/rockbox
decrease the risk of an overflow due to typecase from unsigned to signed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17065 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
bf8e9994c0
commit
10080b8420
1 changed files with 2 additions and 2 deletions
|
@ -737,8 +737,8 @@ int rotleft(unsigned char *dst, /* output buffer */
|
||||||
src_words = BITMAP_WORDS(width) * height;
|
src_words = BITMAP_WORDS(width) * height;
|
||||||
|
|
||||||
if(((height + 7) / 8) * width > dstlen) {
|
if(((height + 7) / 8) * width > dstlen) {
|
||||||
fprintf(stderr, "%s:%d %d x %d overflows %d bytes buffer, needs %d\n",
|
fprintf(stderr, "%s:%d %d x %d overflows %ld bytes buffer, needs %d\n",
|
||||||
__FILE__, __LINE__, width, height, (int)dstlen,
|
__FILE__, __LINE__, width, height, (unsigned long)dstlen,
|
||||||
((height + 7) / 8) * width );
|
((height + 7) / 8) * width );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue