mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/nutdec: fix packet end clearing
The code was buggy, using the wrong variable, also it missed the case where the packet become smaller due to sidedata/metadata being extracted which left a few bytes uninitialized Fixes use of uninitialized memory Fixed: msan_uninit-mem_7f6abbe44530_6838_mewmew_vorbis_ssa.nut Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
77d2a1ca59
commit
7f9697aa11
|
@ -1011,8 +1011,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
|
||||||
if (ret != size) {
|
if (ret != size) {
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
av_shrink_packet(pkt, nut->header_len[header_idx] + size);
|
|
||||||
}
|
}
|
||||||
|
av_shrink_packet(pkt, nut->header_len[header_idx] + ret);
|
||||||
|
|
||||||
pkt->stream_index = stream_id;
|
pkt->stream_index = stream_id;
|
||||||
if (stc->last_flags & FLAG_KEY)
|
if (stc->last_flags & FLAG_KEY)
|
||||||
|
|
Loading…
Reference in New Issue