[FFmpeg-devel] [PATCH 4/4] avcodec/mjpegenc: Don't unnecessarily grow buffer

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Apr 12 02:50:17 EEST 2022


The size of the ICC chunk has already been accounted for when
the packet's buffer was initially set in ff_mpv_encode_picture()
and the header (including the ICC chunk) has already been written
at this point.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mjpegenc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 1e9b97535a..8cada8366c 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -131,7 +131,6 @@ static void mjpeg_encode_picture_frame(MpegEncContext *s)
     }
 
     bytes_needed = (total_bits + 7) / 8;
-    ff_mjpeg_add_icc_profile_size(s->avctx, s->picture->f, &bytes_needed);
     ff_mpv_reallocate_putbitbuffer(s, bytes_needed, bytes_needed);
 
     for (int i = 0; i < m->huff_ncode; i++) {
-- 
2.32.0



More information about the ffmpeg-devel mailing list