diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-12 00:08:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-12 00:08:06 +0100 |
commit | dadc1f5ee9d933cca94469604a15eb3d7bc939f0 (patch) | |
tree | d72d4075d9092cced7cdf7f6b88889fb6e81735f | |
parent | 1e16492b989e0f1bd262be6aaf5ebf7857f46dea (diff) | |
parent | c9c7d59b7d26f0328d612995dd9256337ae1cbfb (diff) | |
download | ffmpeg-dadc1f5ee9d933cca94469604a15eb3d7bc939f0.tar.gz |
Merge commit 'c9c7d59b7d26f0328d612995dd9256337ae1cbfb'
* commit 'c9c7d59b7d26f0328d612995dd9256337ae1cbfb':
tiff: Use av_mallocz_array
Conflicts:
libavcodec/tiffenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/tiffenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 138d214c2f..38ff780da3 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -327,6 +327,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, offset = ptr; bytestream_put_le32(&ptr, 0); + if (strips > INT_MAX / FFMAX(sizeof(s->strip_sizes[0]), sizeof(s->strip_offsets[0]))) { + ret = AVERROR(ENOMEM); + goto fail; + } av_fast_padded_mallocz(&s->strip_sizes , &s->strip_sizes_size , sizeof(s->strip_sizes [0]) * strips); av_fast_padded_mallocz(&s->strip_offsets, &s->strip_offsets_size, sizeof(s->strip_offsets[0]) * strips); |