Commit e49c2aab authored by Michael Niedermayer's avatar Michael Niedermayer

truemotion2: clear the token array if its initialization fails.

Fixes use of uninitialized and half initialized values, which
can occur on several error pathes

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b89815f5
......@@ -888,6 +888,8 @@ static int decode_frame(AVCodecContext *avctx,
t = tm2_read_stream(l, l->buffer + offset, tm2_stream_order[i],
buf_size - offset);
if (t < 0) {
int j = tm2_stream_order[i];
memset(l->tokens[j], 0, sizeof(**l->tokens) * l->tok_lens[j]);
return t;
}
offset += t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment