diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-22 23:56:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-23 00:03:49 +0200 |
commit | 45ae9a8fc903d5b5041a5d34015aa98ab2bc12be (patch) | |
tree | 72840e28de22b9fc5d863ec7ef9844cf8bfdc424 /libavcodec/j2k.c | |
parent | 7c2d5eec29e0433f34cf584fd5293795b7ac023f (diff) | |
download | ffmpeg-streaming-45ae9a8fc903d5b5041a5d34015aa98ab2bc12be.zip ffmpeg-streaming-45ae9a8fc903d5b5041a5d34015aa98ab2bc12be.tar.gz |
j2k: reorder multiplications to avoid interger overflows related to code blocks
Fixes CID703776, CID703775
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/j2k.c')
-rw-r--r-- | libavcodec/j2k.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/j2k.c b/libavcodec/j2k.c index 606a3d8..196d7fd 100644 --- a/libavcodec/j2k.c +++ b/libavcodec/j2k.c @@ -285,7 +285,7 @@ int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantSt band->cblknx = ff_j2k_ceildiv(band->cblknx, dx); band->cblkny = ff_j2k_ceildiv(band->cblkny, dy); - band->cblk = av_malloc(band->cblknx * band->cblkny * sizeof(J2kCblk)); + band->cblk = av_malloc(sizeof(J2kCblk) * band->cblknx * band->cblkny); if (!band->cblk) return AVERROR(ENOMEM); band->prec = av_malloc(reslevel->num_precincts_x * reslevel->num_precincts_y * sizeof(J2kPrec)); |