PR #22949 opened by Marvin Scholz (ePirat)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22949
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22949.patch

Fixes some more fall-through warnings and a format warning.


>From 190d4efe81de800e04f770cb0292ecaca301e15a Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 15:46:59 +0200
Subject: [PATCH 1/6] avformat/hevc: use correct format specifier

The numOfArrays variable is an integer, so use %d to print it.
---
 libavformat/hevc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index 5924f39503..c9ee11f36c 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -1050,7 +1050,7 @@ static int hvcc_write(void *logctx, AVIOContext *pb,
             hvcc->temporalIdNested);
     av_log(logctx, AV_LOG_TRACE,  "lengthSizeMinusOne:                
%"PRIu8"\n",
             hvcc->lengthSizeMinusOne);
-    av_log(logctx, AV_LOG_TRACE,  "numOfArrays:                       
%"PRIu8"\n",
+    av_log(logctx, AV_LOG_TRACE,  "numOfArrays:                       %d\n",
             numOfArrays);
     for (unsigned i = 0, j = 0; i < FF_ARRAY_ELEMS(hvcc->arrays); i++) {
         const HVCCNALUnitArray *const array = &hvcc->arrays[i];
-- 
2.52.0


>From 578bb971ec8f39edc0ee6a47253208ea7aa7da0d Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 15:52:09 +0200
Subject: [PATCH 2/6] avformat/jvdec: add fall-through annotations

---
 libavformat/jvdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 4f4566f64b..456a8c52e9 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -25,6 +25,7 @@
  * @author Peter Ross <[email protected]>
  */
 
+#include "libavutil/attributes.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem.h"
@@ -182,6 +183,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
                 pkt->flags       |= AV_PKT_FLAG_KEY;
                 return 0;
             }
+            av_fallthrough;
         case JV_VIDEO:
             jv->state++;
             if (jvf->video_size || jvf->palette_size) {
@@ -206,6 +208,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
                     pkt->flags |= AV_PKT_FLAG_KEY;
                 return 0;
             }
+            av_fallthrough;
         case JV_PADDING:
             avio_skip(pb, FFMAX(e->size - jvf->audio_size - jvf->video_size
                                         - jvf->palette_size, 0));
-- 
2.52.0


>From f85d92215b2cbb581627d83f43ceb0688ddaa8da Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 16:01:42 +0200
Subject: [PATCH 3/6] avformat/nuv: add fall-through annotations

---
 libavformat/nuv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 0938660c62..1525e2d597 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -276,6 +276,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt)
                 avio_skip(pb, size);
                 break;
             }
+            av_fallthrough;
         case NUV_VIDEO:
             if (ctx->v_id < 0) {
                 av_log(s, AV_LOG_ERROR, "Video packet in file without video 
stream!\n");
-- 
2.52.0


>From b4c2b1a459a049c12c27f0ed9a825c4129e229f8 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 16:08:03 +0200
Subject: [PATCH 4/6] avfilter/vf_mcdeint: add fall-through annotations

---
 libavfilter/vf_mcdeint.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
index f87f441861..0e5e63fc71 100644
--- a/libavfilter/vf_mcdeint.c
+++ b/libavfilter/vf_mcdeint.c
@@ -49,6 +49,7 @@
  * and almost certainly can be improved...
  */
 
+#include "libavutil/attributes.h"
 #include "libavutil/opt.h"
 #include "libavcodec/avcodec.h"
 #include "libavutil/pixdesc.h"
@@ -141,11 +142,14 @@ static int config_props(AVFilterLink *inlink)
     switch (mcdeint->mode) {
     case MODE_EXTRA_SLOW:
         enc_ctx->refs = 3;
+        av_fallthrough;
     case MODE_SLOW:
         av_dict_set(&opts, "motion_est", "iter", 0);
+        av_fallthrough;
     case MODE_MEDIUM:
         enc_ctx->flags |= AV_CODEC_FLAG_4MV;
         enc_ctx->dia_size = 2;
+        av_fallthrough;
     case MODE_FAST:
         enc_ctx->flags |= AV_CODEC_FLAG_QPEL;
     }
-- 
2.52.0


>From f332bcd7bec25b071412a041a40dd11102b73a1e Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 16:10:21 +0200
Subject: [PATCH 5/6] avcodec/av1dec: replace fall-through comment with
 annotation

---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 90621caeb6..65d788bffa 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -1461,7 +1461,7 @@ static int av1_receive_frame_internal(AVCodecContext 
*avctx, AVFrame *frame)
         case AV1_OBU_TEMPORAL_DELIMITER:
             s->raw_frame_header = NULL;
             raw_tile_group      = NULL;
-        // fall-through
+            av_fallthrough;
         case AV1_OBU_TILE_LIST:
         case AV1_OBU_PADDING:
             break;
-- 
2.52.0


>From 6680e84cd717ef238f31ddc75bd0de3b67731770 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 28 Apr 2026 16:13:07 +0200
Subject: [PATCH 6/6] avcodec/lcevc_parser: replace fall-through comment with
 annotation

---
 libavcodec/lcevc_parser.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/lcevc_parser.c b/libavcodec/lcevc_parser.c
index ce1635edb9..d3d6c38bd3 100644
--- a/libavcodec/lcevc_parser.c
+++ b/libavcodec/lcevc_parser.c
@@ -18,6 +18,7 @@
 
 #include <stdint.h>
 
+#include "libavutil/attributes.h"
 #include "libavutil/mem.h"
 
 #include "avcodec.h"
@@ -188,7 +189,7 @@ static int parse_nal_units(AVCodecParserContext *s, const 
uint8_t *buf,
         switch (nal->type) {
         case LCEVC_IDR_NUT:
             s->key_frame = 1;
-        // fall-through
+            av_fallthrough;
         case LCEVC_NON_IDR_NUT:
             parse_nal_unit(s, avctx, nal);
             break;
-- 
2.52.0

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

Reply via email to