diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-04-05 00:28:33 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-04-05 06:34:21 +0200 |
commit | c0ebbd4ccb00df33828dd8b4ef79a172c3a51169 (patch) | |
tree | b539afc88782b6f8c0dc779880112d1ef364c487 /apps/recorder/jpeg_load.c | |
parent | 191ffe272b8fb81924814b95504313a5d9f63526 (diff) | |
download | rockbox-c0ebbd4ccb00df33828dd8b4ef79a172c3a51169.tar.gz rockbox-c0ebbd4ccb00df33828dd8b4ef79a172c3a51169.zip |
jpeg: Fix an overflow when decoding images for non-color targets.
(Warning raised by GCC 4.9.4 -Os)
Change-Id: I1d2f491c8bdb11fe89ffb119e248ca0f4eb69de2
Diffstat (limited to 'apps/recorder/jpeg_load.c')
-rw-r--r-- | apps/recorder/jpeg_load.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c index e326d1c18a..61ec3bfa0e 100644 --- a/apps/recorder/jpeg_load.c +++ b/apps/recorder/jpeg_load.c | |||
@@ -1541,7 +1541,14 @@ INLINE void fix_huff_tables(struct jpeg *p_jpeg) | |||
1541 | INLINE void fix_quant_tables(struct jpeg *p_jpeg) | 1541 | INLINE void fix_quant_tables(struct jpeg *p_jpeg) |
1542 | { | 1542 | { |
1543 | int shift, i, j; | 1543 | int shift, i, j; |
1544 | for (i = 0; i < 2; i++) | 1544 | |
1545 | #ifdef HAVE_LCD_COLOR | ||
1546 | const int k = 2; | ||
1547 | #else | ||
1548 | const int k = 1; | ||
1549 | #endif | ||
1550 | |||
1551 | for (i = 0; i < k; i++) | ||
1545 | { | 1552 | { |
1546 | shift = idct_tbl[p_jpeg->v_scale[i]].scale; | 1553 | shift = idct_tbl[p_jpeg->v_scale[i]].scale; |
1547 | if (shift) | 1554 | if (shift) |