diff mbox series

[FFmpeg-devel,v2,3/4] avformat/nutdec: Don't shrink packet size manually

Message ID GV1P250MB07377CB3740FAECF99766DBB8F4C9@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 843fe314ea30a3b7ccaa165031663292d14a9e02
Headers show
Series [FFmpeg-devel,v2,1/4] avcodec/h264_redundant_pps_bsf: Don't remove PPS | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/configure_x86 warning Failed to run configure

Commit Message

Andreas Rheinhardt Sept. 20, 2022, 4:46 p.m. UTC
It is unnecessary because an av_shrink_packet() a few lines below
will set the size; furthermore, it is actually harmful, because
av_shrink_packet() does nothing in case the size already matches,
so that the packet's padding is not correctly zeroed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I was about to make append_packet_chunked non-static, but then I noticed
that it unrefs the packet if the end size is zero (this might cause
problems for side-data only packets).

 libavformat/nutdec.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 8cc56615ad..1d04f51d8d 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1127,7 +1127,6 @@  static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
         }
         sm_size = avio_tell(bc) - pkt->pos;
         size      -= sm_size;
-        pkt->size -= sm_size;
     }
 
     ret = avio_read(bc, pkt->data + nut->header_len[header_idx], size);