1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-23 04:41:41 +01:00
parent b89815f519
commit e49c2aab80

View File

@ -888,6 +888,8 @@ static int decode_frame(AVCodecContext *avctx,
t = tm2_read_stream(l, l->buffer + offset, tm2_stream_order[i], t = tm2_read_stream(l, l->buffer + offset, tm2_stream_order[i],
buf_size - offset); buf_size - offset);
if (t < 0) { if (t < 0) {
int j = tm2_stream_order[i];
memset(l->tokens[j], 0, sizeof(**l->tokens) * l->tok_lens[j]);
return t; return t;
} }
offset += t; offset += t;