summaryrefslogtreecommitdiff
path: root/libavformat/nutdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-10 00:32:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-10 00:34:15 +0100
commit7f9697aa114c9c452272351de759a6291e782da9 (patch)
tree34a77062613f41685f0e9bad90ac0991d78317eb /libavformat/nutdec.c
parent77d2a1ca595ebe082d35c4b624ac9a9145991494 (diff)
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>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 250e13fd9a..5746416180 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -1011,8 +1011,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
if (ret != size) {
if (ret < 0)
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;
if (stc->last_flags & FLAG_KEY)