1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avcodec/vqavideo: allocate the codebook zeroed

Fixes: use of uninitialized memory
Fixes: Tt4RMe2vAHv6
Fixes: trithem-vqa-cbf0-short-read-2389ec50.vqa
Fixes: vqa-cbf0-empty-variant.vqa
Found-by: Trithem90
This commit is contained in:
Michael Niedermayer
2026-09-24 00:56:23 +02:00
committed by michaelni
parent 5474b1e05a
commit f9df3577ac

View File

@@ -183,7 +183,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
/* allocate codebooks */
s->codebook_size = MAX_CODEBOOK_SIZE;
s->codebook = av_malloc(s->codebook_size);
s->codebook = av_mallocz(s->codebook_size);
if (!s->codebook)
return AVERROR(ENOMEM);
s->next_codebook_buffer = av_malloc(s->codebook_size);