Commit e58c4eb98f for ffmpeg
commit e58c4eb98f0f3c0523089fb9d037eedfcbd204d9
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Nov 3 04:31:08 2026 +0100
avcodec/cscd: allocate the decompression buffer zeroed
Short payloads are accepted since d2a0464fc2 and ab7d38f970.
Fixes: use of uninitialized memory
Fixes: Eivz8cYLGnrh
Fixes: AISLE-2026-0150-00238, AISLE-2026-0150-00058
Use of uninitialized memory Replicated through UnModified FFmpeg with Valgrind
Found-by: Joshua Rogers (AISLE)
diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index e552b0a14f..6b3c0b1346 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -149,7 +149,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->height = avctx->height;
stride = FFALIGN(c->linelen, 4);
c->decomp_size = c->height * stride;
- c->decomp_buf = av_malloc(c->decomp_size + AV_LZO_OUTPUT_PADDING);
+ c->decomp_buf = av_mallocz(c->decomp_size + AV_LZO_OUTPUT_PADDING);
if (!c->decomp_buf) {
av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
return AVERROR(ENOMEM);