This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit d521215ce6ca13326a04798b2508610d49ef368f
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Nov 5 03:41:23 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 02:46:17 2026 +0100

    avcodec/roqaudioenc: encode the buffered samples when flushed early
    
    Encode the buffered samples once and return no packet when the buffer
    is empty.
    
    Fixes: use of uninitialized memory
    Fixes: X43TLCpjYK88
    Fixes: AISLE-2026-0150-00397
    Use of uninitialized memory Replicated through UnModified FFmpeg with 
Valgrind
    
    Found-by: Joshua Rogers (AISLE)
    The fix was suggested in the report.
    
    (cherry picked from commit f71410e0288f0c40ae2fb5e5a4d7428763d08a71)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/roqaudioenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c
index 8a626c0d29..c0e9967ab4 100644
--- a/libavcodec/roqaudioenc.c
+++ b/libavcodec/roqaudioenc.c
@@ -131,7 +131,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
 
     stereo = (channels == 2);
 
-    if (!in && context->input_frames >= 8)
+    if (!in && (context->input_frames >= 8 || !context->buffered_samples))
         return 0;
 
     if (in && context->input_frames < 8) {
@@ -153,7 +153,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
         context->lastSample[1] &= 0xFF00;
     }
 
-    if (context->input_frames == 7)
+    if (context->input_frames < 8)
         data_size = channels * context->buffered_samples;
     else
         data_size = channels * avctx->frame_size;
@@ -181,7 +181,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
     avpkt->duration = data_size / channels;
 
     context->input_frames++;
-    if (!in)
+    if (!frame)
         context->input_frames = FFMAX(context->input_frames, 8);
 
     *got_packet_ptr = 1;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to