[FFmpeg-cvslog] avcodec/mjpegenc: Don't unnecessarily grow buffer

Andreas Rheinhardt git at videolan.org
Thu Apr 14 20:03:43 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Apr 12 00:14:32 2022 +0200| [202da3bf486c8168170597b01f8261de288c250c] | committer: Andreas Rheinhardt

avcodec/mjpegenc: Don't unnecessarily grow buffer

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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=202da3bf486c8168170597b01f8261de288c250c
---

 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++) {



More information about the ffmpeg-cvslog mailing list