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

Git pushed a commit to branch master
in repository ffmpeg.

commit 089e86692c58822e9ac8e56d890066e99a0056f2
Author:     Zhao Zhili <[email protected]>
AuthorDate: Tue Jul 7 14:49:49 2026 +0800
Commit:     James Almer <[email protected]>
CommitDate: Tue Jul 7 19:04:42 2026 +0000

    avcodec/bsf: fix codec-id match loop in av_bsf_link
    
    The break statement only exits the inner j loop, so the outer i loop
    always runs to the AV_CODEC_ID_NONE terminator and the match result is
    never recorded.
    
    Signed-off-by: Zhao Zhili <[email protected]>
---
 libavcodec/bitstreamfilter.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavcodec/bitstreamfilter.c b/libavcodec/bitstreamfilter.c
index ae445143fe..57310e417e 100644
--- a/libavcodec/bitstreamfilter.c
+++ b/libavcodec/bitstreamfilter.c
@@ -144,13 +144,18 @@ int av_bsf_link(AVBitStreamFilterContext *src, unsigned 
srcpad,
     }
 
     if (src->output_pads[srcpad].codec_ids && 
dst->input_pads[dstpad].codec_ids) {
-        int i;
-        for (i = 0; src->output_pads[srcpad].codec_ids[i] != AV_CODEC_ID_NONE; 
i++)
+        int i, found = 0;
+        for (i = 0; src->output_pads[srcpad].codec_ids[i] != AV_CODEC_ID_NONE; 
i++) {
             for (int j = 0; dst->input_pads[dstpad].codec_ids[j] != 
AV_CODEC_ID_NONE; j++)
-                if (src->output_pads[srcpad].codec_ids[i] == 
dst->input_pads[dstpad].codec_ids[j])
+                if (src->output_pads[srcpad].codec_ids[i] == 
dst->input_pads[dstpad].codec_ids[j]) {
+                    found = 1;
                     break;
+                }
+            if (found)
+                break;
+        }
 
-        if (src->output_pads->codec_ids[i] == AV_CODEC_ID_NONE) {
+        if (!found) {
             av_log(src, AV_LOG_ERROR, "No common codec id between source and 
dest pads\n");
                        av_log(src, AV_LOG_ERROR, "Supported input pad codecs 
are: ");
             for (i = 0; dst->input_pads->codec_ids[i] != AV_CODEC_ID_NONE; 
i++) {

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to