Patch attached.
From c539fcd63ca339c0299029f9de1b2aff613e3da8 Mon Sep 17 00:00:00 2001
From: Paul B Mahol <one...@gmail.com>
Date: Wed, 31 Aug 2022 18:36:04 +0200
Subject: [PATCH] avcodec/amr*bdec: return only number of consumed bytes

Signed-off-by: Paul B Mahol <one...@gmail.com>
---
 libavcodec/amrnbdec.c | 2 +-
 libavcodec/amrwbdec.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 8c1073916e..0a2e697e6d 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -1092,7 +1092,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     *got_frame_ptr = 1;
 
-    return avpkt->size;
+    return buf - avpkt->data;
 }
 
 
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 6a5b79f52c..4f5e454b52 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -1289,7 +1289,7 @@ static int amrwb_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     *got_frame_ptr = 1;
 
-    return avpkt->size;
+    return buf - avpkt->data;
 }
 
 const FFCodec ff_amrwb_decoder = {
-- 
2.37.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to