* [FFmpeg-devel] Re: [PATCH] avcodec/adpcm: Fix the decoding error caused by incorrect retrieval of step_index in ADPCM module
2025-12-01 2:00 [FFmpeg-devel] [PATCH] avcodec/adpcm: Fix the decoding error caused by incorrect retrieval of step_index in ADPCM module 唐莎 via ffmpeg-devel
@ 2025-12-01 2:19 ` James Almer via ffmpeg-devel
0 siblings, 0 replies; 2+ messages in thread
From: James Almer via ffmpeg-devel @ 2025-12-01 2:19 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: James Almer
[-- Attachment #1.1.1: Type: text/plain, Size: 1381 bytes --]
>>From 3a21c9f12121f3e8bcaa704422750a8f45c7e50e Mon Sep 17 00:00:00 2001
> From: tangsha <tangsha@kylinos.cn>
> Date: Thu, 28 Aug 2025 17:45:19 +0800
> Subject: [PATCH] avcodec/adpcm: Fix the decoding error caused by incorrect
> retrieval of step_index in ADPCM module
>
> ---
> libavcodec/adpcm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> index 4c15be6207..d01d6cd8e4 100644
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -1345,7 +1345,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
Those line offsets are not from the master branch. Are you writing this
targeting a release branch?
> ADPCMChannelStatus *cs = &c->status[i];
> cs->predictor = samples_p[i][0] = sign_extend(bytestream2_get_le16u(&gb), 16);
>
> - cs->step_index = sign_extend(bytestream2_get_le16u(&gb), 16);
> + cs->step_index = bytestream2_get_byteu(&gb);
> + bytestream2_skip(&gb, sizeof(uint8_t));
What's in this byte if not a part of step_index? Also, do you have a
sample that gets fixed by this change?
> if (cs->step_index > 88u){
> av_log(avctx, AV_LOG_ERROR, "ERROR: step_index[%d] = %i\n",
> i, cs->step_index);
> --
> 2.25.1
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 163 bytes --]
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread