From 7aa71ab5c04cbff9ed4eb7c2925ceb33a8e4e970 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 30 Aug 2023 23:00:37 +0200 Subject: [PATCH] avcodec/rka: do not output extra invalid samples in last frame --- libavcodec/rka.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/rka.c b/libavcodec/rka.c index 7646d776be..92c1237d1f 100644 --- a/libavcodec/rka.c +++ b/libavcodec/rka.c @@ -949,6 +949,10 @@ static int rka_decode_frame(AVCodecContext *avctx, AVFrame *frame, } } + if (frame->nb_samples < s->frame_samples && + frame->nb_samples > s->last_nb_samples) + frame->nb_samples = s->last_nb_samples; + *got_frame_ptr = 1; return avpkt->size;