forked from len0rd/rockbox
Do not resize images greater than 32767 pixels in either dimension
Internally, the resizing code uses the rockbox dim structure, which uses signed shorts. Change-Id: Ic8850e8563a9d8c0cb3cf8269e2576be9e42b45b
This commit is contained in:
parent
56f4ec9668
commit
64cc9aad73
1 changed files with 9 additions and 0 deletions
9
apps/recorder/jpeg_load.c
Normal file → Executable file
9
apps/recorder/jpeg_load.c
Normal file → Executable file
|
|
@ -2050,6 +2050,15 @@ int clip_jpeg_fd(int fd,
|
||||||
if (!(status & DHT)) /* if no Huffman table present: */
|
if (!(status & DHT)) /* if no Huffman table present: */
|
||||||
default_huff_tbl(p_jpeg); /* use default */
|
default_huff_tbl(p_jpeg); /* use default */
|
||||||
fix_headers(p_jpeg); /* derive Huffman and other lookup-tables */
|
fix_headers(p_jpeg); /* derive Huffman and other lookup-tables */
|
||||||
|
|
||||||
|
/*the dim array in rockbox is limited to 2^15-1 pixels, so we cannot resize
|
||||||
|
images larger than this without overflowing */
|
||||||
|
if(p_jpeg->x_size > 32767 || p_jpeg->y_size > 32767)
|
||||||
|
{
|
||||||
|
JDEBUGF("Aborting resize of image > 32767 pixels\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
src_dim.width = p_jpeg->x_size;
|
src_dim.width = p_jpeg->x_size;
|
||||||
src_dim.height = p_jpeg->y_size;
|
src_dim.height = p_jpeg->y_size;
|
||||||
if (format & FORMAT_RESIZE)
|
if (format & FORMAT_RESIZE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue