Skip to content
Snippets Groups Projects
Commit 03acb035 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/vqavideo: clear uninitialized parts of the decode buffer


Fixes use of uninitialized memory
Fixes part of msan_uninit-mem_7f841fe2ab3b_4608_cow2_1.vqa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent 263105de
No related branches found
No related tags found
No related merge requests found
...@@ -303,9 +303,11 @@ static int decode_format80(VqaContext *s, int src_size, ...@@ -303,9 +303,11 @@ static int decode_format80(VqaContext *s, int src_size,
* codebook entry; it is not important for compressed codebooks because * codebook entry; it is not important for compressed codebooks because
* not every entry needs to be filled */ * not every entry needs to be filled */
if (check_size) if (check_size)
if (dest_index < dest_size) if (dest_index < dest_size) {
av_log(s->avctx, AV_LOG_ERROR, "decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n", av_log(s->avctx, AV_LOG_ERROR, "decode_format80 problem: decode finished with dest_index (%d) < dest_size (%d)\n",
dest_index, dest_size); dest_index, dest_size);
memset(dest + dest_index, 0, dest_size - dest_index);
}
return 0; // let's display what we decoded anyway return 0; // let's display what we decoded anyway
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment