aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-30 21:51:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-01 23:12:07 +0100
commitb5587fd2c6ce39bad7a5e7ebb3bd86b6469648de (patch)
tree67609c94bb610354ab76aadb906f62cde6049535 /libavcodec/jpeg2000.c
parent0674087004538599797688785f6ac82358abc23b (diff)
downloadffmpeg-b5587fd2c6ce39bad7a5e7ebb3bd86b6469648de.tar.gz
avcodec/jpeg2000: Only allocate Jpeg2000Pass for the encoder
Reduces memory needed. Fixes: OOM Fixes: 4427/clusterfuzz-testcase-minimized-5106919271301120 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.c')
-rw-r--r--libavcodec/jpeg2000.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 8551cf8d6c..5f3965047f 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -606,6 +606,7 @@ void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
for (cblkno = 0; cblkno < nb_code_blocks; cblkno ++) {
Jpeg2000Cblk *cblk = &prec->cblk[cblkno];
av_freep(&cblk->data);
+ av_freep(&cblk->passes);
}
av_freep(&prec->cblk);
}