diff mbox series

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

Message ID DU2PR01MB795080E7F77E8838261249C78FEA9@DU2PR01MB7950.eurprd01.prod.exchangelabs.com
State Accepted
Commit 202da3bf486c8168170597b01f8261de288c250c
Headers show
Series [FFmpeg-devel,1/4] avcodec/mpegvideo_enc: Ignore ICC profile size when not MJPEG | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Andreas Rheinhardt April 11, 2022, 11:50 p.m. UTC
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@outlook.com>
 libavcodec/mjpegenc.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series


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