avcodec/adpcmenc: encode all samples of a mono ADPCM_MS block with trellis

Fixes: use of uninitialized memory
Fixes: 98u4sU59NEf4
Fixes: AISLE-2026-0150-00113
Use of uninitialized memory Replicated through UnModified FFmpeg with Valgrind

Found-by: Joshua Rogers (AISLE)
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-11-05 23:01:56 +00:00
1 parent f71410e028
commit fb13409aaf
1 file changed
+2 -2
+2 -2
View File
@@ -782,9 +782,9 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (!buf)
return AVERROR(ENOMEM);
if (channels == 1) {
adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n,
adpcm_compress_trellis(avctx, samples, buf, &c->status[0], 2 * n,
channels);
for (int i = 0; i < n; i += 2)
for (int i = 0; i < 2 * n; i += 2)
*dst++ = (buf[i] << 4) | buf[i + 1];
} else {
adpcm_compress_trellis(avctx, samples, buf,