summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-12-17 18:29:45 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-21 19:48:41 +0100
commit42274db1c623d2c0acd616cc0d3a0e5489e3bdb2 (patch)
tree1f6cfebde5da75dc9a70287f159cddbb6ad080ee /libavcodec/jpeg2000.h
parent1083859cb8c9d9b3bcee970dd33b71015a0a11bc (diff)
avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as needed
Decreases memory requirements Fixes: OOM Fixes: 4525/clusterfuzz-testcase-minimized-6400713073623040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000.h')
-rw-r--r--libavcodec/jpeg2000.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 752feae96b..c429ca5996 100644
--- a/libavcodec/jpeg2000.h
+++ b/libavcodec/jpeg2000.h
@@ -165,14 +165,14 @@ typedef struct Jpeg2000Cblk {
uint8_t ninclpasses; // number coding of passes included in codestream
uint8_t nonzerobits;
uint16_t length;
- uint16_t lengthinc[JPEG2000_MAX_PASSES];
+ uint16_t *lengthinc;
uint8_t nb_lengthinc;
uint8_t lblock;
uint8_t *data;
size_t data_allocated;
int nb_terminations;
int nb_terminationsinc;
- int data_start[JPEG2000_MAX_PASSES];
+ int *data_start;
Jpeg2000Pass *passes;
int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
} Jpeg2000Cblk; // code block