aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-02-23 12:30:55 +0100
committerPaul B Mahol <onemda@gmail.com>2021-02-23 12:38:57 +0100
commitd7f10b24975f06e0865f071c4ca5c9cadaf8b8bb (patch)
treee55c5a065ccf37af96f8812193f4f317b5de2a79 /libavcodec
parent081cbe6961f03cd27fe044d4f2b53ae81307e715 (diff)
downloadffmpeg-d7f10b24975f06e0865f071c4ca5c9cadaf8b8bb.tar.gz
avcodec/exrenc: use correct type for actual_size as argument for zlib
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/exrenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index 305d44ad2d..7d1d4fa4d8 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -251,6 +251,7 @@ static int encode_scanline_zip(EXRContext *s, const AVFrame *frame)
const int scanline_height = FFMIN(s->scanline_height, frame->height - y * s->scanline_height);
int64_t tmp_size = 4LL * s->planes * frame->width * scanline_height;
int64_t max_compressed_size = tmp_size * 3 / 2;
+ unsigned long actual_size, source_size;
av_fast_padded_malloc(&scanline->uncompressed_data, &scanline->uncompressed_size, tmp_size);
if (!scanline->uncompressed_data)
@@ -278,10 +279,12 @@ static int encode_scanline_zip(EXRContext *s, const AVFrame *frame)
reorder_pixels(scanline->tmp, scanline->uncompressed_data, tmp_size);
predictor(scanline->tmp, tmp_size);
- scanline->actual_size = max_compressed_size;
- compress(scanline->compressed_data, &scanline->actual_size,
- scanline->tmp, tmp_size);
+ source_size = tmp_size;
+ actual_size = max_compressed_size;
+ compress(scanline->compressed_data, &actual_size,
+ scanline->tmp, source_size);
+ scanline->actual_size = actual_size;
if (scanline->actual_size >= tmp_size) {
FFSWAP(uint8_t *, scanline->uncompressed_data, scanline->compressed_data);
FFSWAP(int, scanline->uncompressed_size, scanline->compressed_size);