avcodec/wmaenc: Fix missing padding in extradata

Reported-by: Kenan Alghythee <kalghy2@uic.edu>
This commit is contained in:
Michael Niedermayer
2026-05-03 02:36:54 +00:00
committed by michaelni
parent 242ff799c7
commit 23227a444d
+2 -2
View File
@@ -65,14 +65,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
flags1 = 0;
flags2 = 1;
if (avctx->codec->id == AV_CODEC_ID_WMAV1) {
extradata = av_malloc(4);
extradata = av_mallocz(4 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata)
return AVERROR(ENOMEM);
avctx->extradata_size = 4;
AV_WL16(extradata, flags1);
AV_WL16(extradata + 2, flags2);
} else if (avctx->codec->id == AV_CODEC_ID_WMAV2) {
extradata = av_mallocz(10);
extradata = av_mallocz(10 + AV_INPUT_BUFFER_PADDING_SIZE);
if (!extradata)
return AVERROR(ENOMEM);
avctx->extradata_size = 10;