mirror of https://github.com/GNOME/gimp.git
SGI: fix out of bounds writes
The functions read_rle8() and read_rle16() didn't check if the addresses to which they wrote are in bounds when expanding runlength encoded data.
This commit is contained in:
parent
838be627be
commit
4d9724f2f6
|
@ -680,7 +680,7 @@ read_rle8(sgi_t *sgip, /* I - SGI image to read from */
|
|||
return (-1);
|
||||
length ++;
|
||||
|
||||
count = ch & 127;
|
||||
count = MIN (ch & 127, xsize);
|
||||
if (count == 0)
|
||||
break;
|
||||
|
||||
|
@ -725,7 +725,7 @@ read_rle16(sgi_t *sgip, /* I - SGI image to read from */
|
|||
return (-1);
|
||||
length ++;
|
||||
|
||||
count = ch & 127;
|
||||
count = MIN (ch & 127, xsize);
|
||||
if (count == 0)
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue