[FFmpeg-cvslog] avcodec/exrenc: use correct type for actual_size as argument for zlib
Paul B Mahol
git at videolan.org
Tue Feb 23 13:39:18 EET 2021
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Feb 23 12:30:55 2021 +0100| [d7f10b24975f06e0865f071c4ca5c9cadaf8b8bb] | committer: Paul B Mahol
avcodec/exrenc: use correct type for actual_size as argument for zlib
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7f10b24975f06e0865f071c4ca5c9cadaf8b8bb
---
libavcodec/exrenc.c | 9 ++++++---
1 file 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);
More information about the ffmpeg-cvslog
mailing list