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@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-04-12 00:14:32 +02:00
parent f703cbabdb
commit 202da3bf48
1 changed files with 0 additions and 1 deletions

View File

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