PR #22952 opened by mkver URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22952 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22952.patch
>From 73aa3e393652ef8d5f6078faf89ea6669832d968 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:18:45 +0200 Subject: [PATCH 01/28] swscale/x86/swscale: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libswscale/x86/swscale.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index 25461d787f..68cf15e772 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -763,7 +763,8 @@ switch(c->dstBpc){ \ #define INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(fmt, name, opt) \ case fmt: \ - c->readAlpPlanar = ff_planar_##name##_to_a_##opt; + c->readAlpPlanar = ff_planar_##name##_to_a_##opt; \ + av_fallthrough; #define INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \ case rgba_fmt: \ -- 2.52.0 >From 6f2ce0ac888364dad1b1a7a2bf39e4cecf93ee4b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:21:36 +0200 Subject: [PATCH 02/28] swscale/x86/swscale: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libswscale/x86/swscale.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index 68cf15e772..04782da81c 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -91,7 +91,6 @@ void ff_updateMMXDitherTables(SwsInternal *c, int dstY) const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPlane->line + firstChrSrcY - chrUPlane->sliceY; const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && hasAlpha) ? (const int16_t **)(void*) alpPlane->line + firstLumSrcY - alpPlane->sliceY : NULL; - int i; if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->opts.src_h) { const int16_t **tmpY = (const int16_t **) lumPlane->tmp; @@ -132,7 +131,7 @@ void ff_updateMMXDitherTables(SwsInternal *c, int dstY) if (flags & SWS_ACCURATE_RND) { int s= APCK_SIZE / 8; - for (i=0; i<vLumFilterSize; i+=2) { + for (int i = 0; i < vLumFilterSize; i += 2) { *(const void**)&lumMmxFilter[s*i ]= lumSrcPtr[i ]; *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4 ]= lumSrcPtr[i+(vLumFilterSize>1)]; lumMmxFilter[s*i+APCK_COEF/4 ]= @@ -145,7 +144,7 @@ void ff_updateMMXDitherTables(SwsInternal *c, int dstY) alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4 ]; } } - for (i=0; i<vChrFilterSize; i+=2) { + for (int i = 0; i < vChrFilterSize; i += 2) { *(const void**)&chrMmxFilter[s*i ]= chrUSrcPtr[i ]; *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4 ]= chrUSrcPtr[i+(vChrFilterSize>1)]; chrMmxFilter[s*i+APCK_COEF/4 ]= @@ -153,7 +152,7 @@ void ff_updateMMXDitherTables(SwsInternal *c, int dstY) + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1] * (1 << 16) : 0); } } else { - for (i=0; i<vLumFilterSize; i++) { + for (int i = 0; i < vLumFilterSize; i++) { *(const void**)&lumMmxFilter[4*i+0]= lumSrcPtr[i]; lumMmxFilter[4*i+2]= lumMmxFilter[4*i+3]= @@ -164,7 +163,7 @@ void ff_updateMMXDitherTables(SwsInternal *c, int dstY) alpMmxFilter[4*i+3]= lumMmxFilter[4*i+2]; } } - for (i=0; i<vChrFilterSize; i++) { + for (int i = 0; i < vChrFilterSize; i++) { *(const void**)&chrMmxFilter[4*i+0]= chrUSrcPtr[i]; chrMmxFilter[4*i+2]= chrMmxFilter[4*i+3]= -- 2.52.0 >From 28dfd64c54a3c4b9fb15ae29d267f243d4930531 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:22:41 +0200 Subject: [PATCH 03/28] swscale/ops_chain: Use av_fallthrough to mark fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libswscale/ops_chain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/ops_chain.c b/libswscale/ops_chain.c index ff301d4a50..f229bdb3ff 100644 --- a/libswscale/ops_chain.c +++ b/libswscale/ops_chain.c @@ -82,7 +82,7 @@ static int op_match(const SwsOp *op, const SwsOpEntry *entry) case SWS_OP_WRITE: if (op->rw.filter && op->type != entry->type) return 0; - /* fall through */; + av_fallthrough; case SWS_OP_SWAP_BYTES: case SWS_OP_SWIZZLE: /* Only the size matters for these operations */ -- 2.52.0 >From c44eec9bc8299fe5c5b9e03a84c6313c5b452126 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:24:04 +0200 Subject: [PATCH 04/28] avcodec/vdpau_mpeg12: Use av_fallthrough to mark fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/vdpau_mpeg12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c index 4d16f18089..b3ac94f217 100644 --- a/libavcodec/vdpau_mpeg12.c +++ b/libavcodec/vdpau_mpeg12.c @@ -51,7 +51,7 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx, ref = ff_vdpau_get_surface_id(s->next_pic.ptr->f); assert(ref != VDP_INVALID_HANDLE); info->backward_reference = ref; - /* fall through to forward prediction */ + av_fallthrough; case AV_PICTURE_TYPE_P: ref = ff_vdpau_get_surface_id(s->last_pic.ptr->f); info->forward_reference = ref; -- 2.52.0 >From 67bf70f37ec0a8e440151e3e7ffb4f959b5ff03e Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:25:08 +0200 Subject: [PATCH 05/28] avcodec/tta: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/tta.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 467c78514f..644a428c09 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -310,6 +310,7 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, else if (rice->sum1 > ff_tta_shift_16[rice->k1 + 1]) rice->k1++; value += ff_tta_shift_1[rice->k0]; + av_fallthrough; default: rice->sum0 += value - (rice->sum0 >> 4); if (rice->k0 > 0 && rice->sum0 < ff_tta_shift_16[rice->k0]) -- 2.52.0 >From 7105bcfd46d9b9a539909747f1337898d3c3ae77 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:26:22 +0200 Subject: [PATCH 06/28] avcodec/tta: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/tta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 644a428c09..ed839b27fb 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -261,9 +261,8 @@ static int tta_decode_frame(AVCodecContext *avctx, AVFrame *frame, s->ch_ctx[i].predictor = 0; ff_tta_filter_init(filter, ff_tta_filter_configs[s->bps-1]); if (s->format == FORMAT_ENCRYPTED) { - int i; - for (i = 0; i < 8; i++) - filter->qm[i] = sign_extend(s->crc_pass[i], 8); + for (int j = 0; j < 8; j++) + filter->qm[j] = sign_extend(s->crc_pass[j], 8); } ff_tta_rice_init(&s->ch_ctx[i].rice, 10, 10); } -- 2.52.0 >From 177a435ad7e58961ea2867a620a57448fc4dee75 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:29:34 +0200 Subject: [PATCH 07/28] avcodec/tiff: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/tiff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 3e261c99f5..fbc7cf86bb 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1293,6 +1293,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) if (count <= 4) { break; } + av_fallthrough; default: value = UINT_MAX; } -- 2.52.0 >From f248e3f3fdced2a9a38369e6d00bfb17dc83342a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:41:49 +0200 Subject: [PATCH 08/28] avcodec/tiff: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/tiff.c | 55 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index fbc7cf86bb..8a179f0fd0 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1232,11 +1232,11 @@ static int init_image(TiffContext *s, AVFrame *frame) return 1; } -static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den) +static void set_sar(TiffContext *s, unsigned tag, unsigned numerator, unsigned denumerator) { int offset = tag == TIFF_YRES ? 2 : 0; - s->res[offset++] = num; - s->res[offset] = den; + s->res[offset++] = numerator; + s->res[offset] = denumerator; if (s->res[0] && s->res[1] && s->res[2] && s->res[3]) { uint64_t num = s->res[2] * (uint64_t)s->res[1]; uint64_t den = s->res[0] * (uint64_t)s->res[3]; @@ -1256,7 +1256,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) AVFrameSideData *sd; GetByteContext gb_temp; unsigned tag, type, count, off, value = 0, value2 = 1; // value2 is a denominator so init. to 1 - int i, start; + int start; int pos; int ret; double *dp; @@ -1331,7 +1331,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) s->bpp = 0; if (bytestream2_get_bytes_left(&s->gb) < type_sizes[type] * count) return AVERROR_INVALIDDATA; - for (i = 0; i < count; i++) + for (int i = 0; i < count; i++) s->bpp += ff_tget(&s->gb, type, s->le); break; default: @@ -1485,14 +1485,14 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) s->black_level[i] = value / (float)value2; } else if (type == AV_TIFF_SRATIONAL) { - int value = ff_tget_long(&s->gb, s->le); - int value2 = ff_tget_long(&s->gb, s->le); - if (!value2) { + int val = ff_tget_long(&s->gb, s->le); + int val2 = ff_tget_long(&s->gb, s->le); + if (!val2) { av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); - value2 = 1; + val2 = 1; } - s->black_level[i] = value / (float)value2; + s->black_level[i] = val / (float)val2; } else { s->black_level[i] = ff_tget(&s->gb, type, s->le); } @@ -1570,7 +1570,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) return AVERROR_INVALIDDATA; } - for (i = 0; i < count / 3; i++) { + for (unsigned i = 0; i < count / 3; i++) { uint32_t p = 0xFF000000; p |= (ff_tget(&pal_gb[0], type, s->le) >> off) << 16; p |= (ff_tget(&pal_gb[1], type, s->le) >> off) << 8; @@ -1588,7 +1588,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) av_log(s->avctx, AV_LOG_ERROR, "subsample count invalid\n"); return AVERROR_INVALIDDATA; } - for (i = 0; i < count; i++) { + for (unsigned i = 0; i < count; i++) { s->subsampling[i] = ff_tget(&s->gb, type, s->le); if (s->subsampling[i] <= 0) { av_log(s->avctx, AV_LOG_ERROR, "subsampling %d is invalid\n", s->subsampling[i]); @@ -1648,7 +1648,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) s->geotag_count = 0; goto end; } - for (i = 0; i < s->geotag_count; i++) { + for (int i = 0; i < s->geotag_count; i++) { unsigned val; s->geotags[i].key = ff_tget_short(&s->gb, s->le); s->geotags[i].type = ff_tget_short(&s->gb, s->le); @@ -1675,9 +1675,9 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n"); goto end; } - for (i = 0; i < count; i++) + for (unsigned i = 0; i < count; i++) dp[i] = ff_tget_double(&s->gb, s->le); - for (i = 0; i < s->geotag_count; i++) { + for (int i = 0; i < s->geotag_count; i++) { if (s->geotags[i].type == TIFF_GEO_DOUBLE_PARAMS) { if (s->geotags[i].count == 0 || s->geotags[i].offset + s->geotags[i].count > count) { @@ -1699,7 +1699,7 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) break; case TIFF_GEO_ASCII_PARAMS: pos = bytestream2_tell(&s->gb); - for (i = 0; i < s->geotag_count; i++) { + for (int i = 0; i < s->geotag_count; i++) { if (s->geotags[i].type == TIFF_GEO_ASCII_PARAMS) { if (s->geotags[i].count == 0 || s->geotags[i].offset + s->geotags[i].count > count) { @@ -1843,13 +1843,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) case DNG_COLOR_MATRIX2: for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { - int value = ff_tget_long(&s->gb, s->le); - int value2 = ff_tget_long(&s->gb, s->le); - if (!value2) { + int val = ff_tget_long(&s->gb, s->le); + int val2 = ff_tget_long(&s->gb, s->le); + if (!val2) { av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); - value2 = 1; + val2 = 1; } - s->color_matrix[i][j] = value / (float)value2; + s->color_matrix[i][j] = val / (float)val2; } s->use_color_matrix = 1; } @@ -1858,13 +1858,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame) case DNG_CAMERA_CALIBRATION2: for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { - int value = ff_tget_long(&s->gb, s->le); - int value2 = ff_tget_long(&s->gb, s->le); - if (!value2) { + int val = ff_tget_long(&s->gb, s->le); + int val2 = ff_tget_long(&s->gb, s->le); + if (!val2) { av_log(s->avctx, AV_LOG_WARNING, "Invalid denominator\n"); - value2 = 1; + val2 = 1; } - s->camera_calibration[i][j] = value / (float)value2; + s->camera_calibration[i][j] = val / (float)val2; } } break; @@ -1935,7 +1935,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p, int le, ret, plane, planes; int i, j, entries, stride; unsigned soff, ssize; - uint8_t *dst; GetByteContext stripsizes; GetByteContext stripdata; int retry_for_subifd, retry_for_page; @@ -2197,8 +2196,8 @@ again: uint8_t *five_planes = NULL; int remaining = avpkt->size; int decoded_height; + uint8_t *dst = p->data[plane]; stride = p->linesize[plane]; - dst = p->data[plane]; if (s->photometric == TIFF_PHOTOMETRIC_SEPARATED && s->avctx->pix_fmt == AV_PIX_FMT_RGBA) { stride = stride * 5 / 4; -- 2.52.0 >From d79763a9a8b1f30f6daaee651993eec251bbb81b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:43:02 +0200 Subject: [PATCH 09/28] avcodec/sga: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/sga.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/sga.c b/libavcodec/sga.c index b6902452d3..67fd26f7d0 100644 --- a/libavcodec/sga.c +++ b/libavcodec/sga.c @@ -451,6 +451,7 @@ static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; bytestream2_init(gb, s->uncompressed, ret + s->metadata_size); + av_fallthrough; case 0xE7: case 0xC1: s->tiledata_size = s->nb_tiles * 32; -- 2.52.0 >From c56970a66829458eab2811a136d4c199f47a7af4 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:47:52 +0200 Subject: [PATCH 10/28] avcodec/mpegvideo_motion: Add av_unreachable, fix fallthrough warnings Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/mpegvideo_motion.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 741927d809..696cc4980d 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -785,6 +785,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, } break; } + av_unreachable("MV_TYPE_16X8 is only used by MPEG-1/2"); case MV_TYPE_DMV: if (CONFIG_SMALL || is_mpeg12) { if (s->picture_structure == PICT_FRAME) { @@ -815,6 +816,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, } break; } + av_unreachable("MV_TYPE_DMV is only used by MPEG-1/2"); default: av_unreachable("No other mpegvideo MV types exist"); } -- 2.52.0 >From 0169c6f81bbfe1f106c20b50e64f5d1a819dc13c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:49:43 +0200 Subject: [PATCH 11/28] avcodec/mpegvideo_enc: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/mpegvideo_enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 52716c9bfc..994ffce29b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -3058,6 +3058,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ break; case AV_CODEC_ID_MPEG2VIDEO: if (s->c.mb_x == 0 && s->c.mb_y != 0) is_gob_start = 1; + av_fallthrough; case AV_CODEC_ID_MPEG1VIDEO: if (s->c.codec_id == AV_CODEC_ID_MPEG1VIDEO && s->c.mb_y >= 175 || s->mb_skip_run) -- 2.52.0 >From 9149ac64584ae30f0f8e656c85791de2ba249105 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Sat, 21 Feb 2026 18:19:22 +0100 Subject: [PATCH 12/28] avcodec/mpegvideo_enc: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/mpegvideo_enc.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 994ffce29b..7e2d338f2a 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -3674,7 +3674,7 @@ static void set_frame_distances(MPVEncContext *const s) static int encode_picture(MPVMainEncContext *const m, const AVPacket *pkt) { MPVEncContext *const s = &m->s; - int i, ret; + int ret; int bits; int context_count = s->c.slice_context_count; @@ -3752,9 +3752,8 @@ static int encode_picture(MPVMainEncContext *const m, const AVPacket *pkt) NULL, context_count, sizeof(void*)); } } - for(i=1; i<context_count; i++){ + for (int i = 1; i < context_count; i++) merge_context_after_me(s, s->c.enc_contexts[i]); - } m->mc_mb_var_sum = s->me.mc_mb_var_sum_temp; m->mb_var_sum = s->me. mb_var_sum_temp; emms_c(); @@ -3785,7 +3784,7 @@ static int encode_picture(MPVMainEncContext *const m, const AVPacket *pkt) ff_fix_long_mvs(s, NULL, 0, s->p_mv_table, s->f_code, CANDIDATE_MB_TYPE_INTER, !!s->intra_penalty); if (s->c.avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { int j; - for(i=0; i<2; i++){ + for (int i = 0; i < 2; i++) { for(j=0; j<2; j++) ff_fix_long_mvs(s, s->p_field_select_table[i], j, s->c.p_field_mv_table[i][j], s->f_code, CANDIDATE_MB_TYPE_INTER_I, !!s->intra_penalty); @@ -3809,7 +3808,7 @@ static int encode_picture(MPVMainEncContext *const m, const AVPacket *pkt) if (s->c.avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) { int dir, j; for(dir=0; dir<2; dir++){ - for(i=0; i<2; i++){ + for (int i = 0; i < 2; i++) { for(j=0; j<2; j++){ int type= dir ? (CANDIDATE_MB_TYPE_BACKWARD_I|CANDIDATE_MB_TYPE_BIDIR_I) : (CANDIDATE_MB_TYPE_FORWARD_I |CANDIDATE_MB_TYPE_BIDIR_I); @@ -3897,12 +3896,11 @@ static int encode_picture(MPVMainEncContext *const m, const AVPacket *pkt) bits= put_bits_count(&s->pb); m->header_bits = bits - s->last_bits; - for(i=1; i<context_count; i++){ + for (int i = 1; i < context_count; i++) update_duplicate_context_after_me(s->c.enc_contexts[i], s); - } s->c.avctx->execute(s->c.avctx, encode_thread, &s->c.enc_contexts[0], NULL, context_count, sizeof(void*)); - for(i=1; i<context_count; i++){ + for (int i = 1; i<context_count; i++) { if (s->pb.buf_end == s->c.enc_contexts[i]->pb.buf) set_put_bits_buffer_size(&s->pb, FFMIN(s->c.enc_contexts[i]->pb.buf_end - s->pb.buf, INT_MAX/8-BUF_BITS)); merge_context_after_encode(s, s->c.enc_contexts[i]); @@ -4550,8 +4548,7 @@ static int dct_quantize_refine(MPVEncContext *const s, //FIXME breaks denoise? run=0; rle_index=0; for(i=start_i; i<=last_non_zero; i++){ - int j= perm_scantable[i]; - const int level= block[j]; + const int level = block[perm_scantable[i]]; if(level){ run_tab[rle_index++]=run; -- 2.52.0 >From 56a0d5e7c3ad9376d5d41ff05bfce2bed5ccab66 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:54:44 +0200 Subject: [PATCH 13/28] avcodec/hevc/hevcdec: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/hevc/hevcdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 8611909dd3..f398872393 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3196,6 +3196,7 @@ static int find_finish_setup_nal(const HEVCContext *s) case HEVC_NAL_RASL_R: if (!get_bits1(&gb)) // first_slice_segment_in_pic_flag continue; + av_fallthrough; case HEVC_NAL_VPS: case HEVC_NAL_SPS: case HEVC_NAL_PPS: -- 2.52.0 >From 4ff4c1a79e723cfc6af22e45c53aaabd92e1fece Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 20:59:13 +0200 Subject: [PATCH 14/28] avcodec/hevc/hevcdec: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/hevc/hevcdec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index f398872393..b576b09b42 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -1019,7 +1019,7 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext if ((pps->weighted_pred_flag && sh->slice_type == HEVC_SLICE_P) || (pps->weighted_bipred_flag && sh->slice_type == HEVC_SLICE_B)) { - int ret = pred_weight_table(sh, s->avctx, sps, gb); + ret = pred_weight_table(sh, s->avctx, sps, gb); if (ret < 0) return ret; } @@ -2932,7 +2932,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) int *ret; int64_t offset; int64_t startheader, cmpt = 0; - int i, j, res = 0; + int j, res = 0; if (s->sh.slice_ctb_addr_rs + s->sh.num_entry_point_offsets * sps->ctb_width >= sps->ctb_width * sps->ctb_height) { av_log(s->avctx, AV_LOG_ERROR, "WPP ctb addresses are wrong (%d %d %d %d)\n", @@ -2974,7 +2974,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) } } - for (i = 1; i < s->sh.num_entry_point_offsets; i++) { + for (int i = 1; i < s->sh.num_entry_point_offsets; i++) { offset += (s->sh.entry_point_offset[i - 1] - cmpt); for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[i]; j < nal->skipped_bytes; j++) { @@ -3001,7 +3001,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) s->data = data; - for (i = 1; i < s->nb_local_ctx; i++) { + for (unsigned i = 1; i < s->nb_local_ctx; i++) { s->local_ctx[i].first_qp_group = 1; s->local_ctx[i].qp_y = s->local_ctx[0].qp_y; } @@ -3018,7 +3018,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) if (pps->entropy_coding_sync_enabled_flag) s->avctx->execute2(s->avctx, hls_decode_entry_wpp, s->local_ctx, ret, s->sh.num_entry_point_offsets + 1); - for (i = 0; i <= s->sh.num_entry_point_offsets; i++) + for (int i = 0; i <= s->sh.num_entry_point_offsets; i++) res += ret[i]; av_free(ret); @@ -3694,7 +3694,7 @@ static void decode_reset_recovery_point(HEVCContext *s) static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) { - int i, ret = 0; + int ret = 0; int eos_at_start = 1; int flags = (H2645_FLAG_IS_NALFF * !!s->is_nalff) | H2645_FLAG_SMALL_PADDING; @@ -3720,7 +3720,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) return ret; } - for (i = 0; i < s->pkt.nb_nals; i++) { + for (int i = 0; i < s->pkt.nb_nals; i++) { if (s->pkt.nals[i].type == HEVC_NAL_EOB_NUT || s->pkt.nals[i].type == HEVC_NAL_EOS_NUT) { if (eos_at_start) { @@ -3768,7 +3768,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) } /* decode the NAL units */ - for (i = 0; i < s->pkt.nb_nals; i++) { + for (int i = 0; i < s->pkt.nb_nals; i++) { H2645NAL *nal = &s->pkt.nals[i]; if (s->avctx->skip_frame >= AVDISCARD_ALL || -- 2.52.0 >From 8c8e7d848d2720aa29c7d16ca694d00d81b45a06 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:01:08 +0200 Subject: [PATCH 15/28] avcodec/aac/aacdec: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/aac/aacdec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c index 994f78bf40..5f41a86abf 100644 --- a/libavcodec/aac/aacdec.c +++ b/libavcodec/aac/aacdec.c @@ -676,6 +676,7 @@ ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id) ac->tags_mapped++; return ac->tag_che_map[type][elem_id] = ac->che[type][elem_id]; } + av_fallthrough; case 13: if (ac->tags_mapped > 3 && ((type == TYPE_CPE && elem_id < 8) || (type == TYPE_SCE && elem_id < 6) || @@ -683,17 +684,20 @@ ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id) ac->tags_mapped++; return ac->tag_che_map[type][elem_id] = ac->che[type][elem_id]; } + av_fallthrough; case 12: case 7: if (ac->tags_mapped == 3 && type == TYPE_CPE) { ac->tags_mapped++; return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2]; } + av_fallthrough; case 11: if (ac->tags_mapped == 3 && type == TYPE_SCE) { ac->tags_mapped++; return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; } + av_fallthrough; case 6: /* Some streams incorrectly code 5.1 audio as * SCE[0] CPE[0] CPE[1] SCE[1] @@ -711,11 +715,13 @@ ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id) ac->tags_mapped++; return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0]; } + av_fallthrough; case 5: if (ac->tags_mapped == 2 && type == TYPE_CPE) { ac->tags_mapped++; return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1]; } + av_fallthrough; case 4: /* Some streams incorrectly code 4.0 audio as * SCE[0] CPE[0] LFE[0] @@ -739,6 +745,7 @@ ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id) ac->tags_mapped++; return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; } + av_fallthrough; case 3: case 2: if (ac->tags_mapped == (ac->oc[1].m4ac.chan_config != 2) && @@ -750,11 +757,13 @@ ChannelElement *ff_aac_get_che(AACDecContext *ac, int type, int elem_id) ac->tags_mapped++; return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1]; } + av_fallthrough; case 1: if (!ac->tags_mapped && type == TYPE_SCE) { ac->tags_mapped++; return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][0]; } + av_fallthrough; default: return NULL; } -- 2.52.0 >From 34f1ce06e6d63bd18cb2df239f3d833bf4a0e4c2 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:02:24 +0200 Subject: [PATCH 16/28] avcodec/aac/aacdec: FIx shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/aac/aacdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c index 5f41a86abf..73e2457924 100644 --- a/libavcodec/aac/aacdec.c +++ b/libavcodec/aac/aacdec.c @@ -1249,7 +1249,7 @@ av_cold int ff_aac_decode_init(AVCodecContext *avctx) ac->oc[1].m4ac.chan_config = i; if (ac->oc[1].m4ac.chan_config) { - int ret = ff_aac_set_default_channel_config(ac, avctx, layout_map, + ret = ff_aac_set_default_channel_config(ac, avctx, layout_map, &layout_map_tags, ac->oc[1].m4ac.chan_config); if (!ret) -- 2.52.0 >From 07919fb45882b4cc9aa7229780dc77ebcd53c312 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:03:04 +0200 Subject: [PATCH 17/28] avformat/rmdec: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavformat/rmdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 2909698cda..a548cd58fc 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -215,6 +215,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, break; case AV_CODEC_ID_COOK: sti->need_parsing = AVSTREAM_PARSE_HEADERS; + av_fallthrough; case AV_CODEC_ID_ATRAC3: case AV_CODEC_ID_SIPR: if (read_all) { -- 2.52.0 >From 67744eba3dd93a685754e24695315bc9a49b845c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Sat, 21 Feb 2026 14:18:24 +0100 Subject: [PATCH 18/28] avformat/rmdec: Fix shadowing Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavformat/rmdec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index a548cd58fc..4a8e2f08df 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -1201,7 +1201,7 @@ static int ivr_probe(const AVProbeData *p) static int ivr_read_header(AVFormatContext *s) { unsigned tag, type, len, tlen, value; - int i, j, n, count, nb_streams = 0, ret; + int i, n, count, nb_streams = 0, ret; uint8_t key[256], val[256]; AVIOContext *pb = s->pb; AVStream *st; @@ -1255,7 +1255,7 @@ static int ivr_read_header(AVFormatContext *s) av_log(s, AV_LOG_DEBUG, "%s = '%s'\n", key, val); } else if (type == 4) { av_log(s, AV_LOG_DEBUG, "%s = '0x", key); - for (j = 0; j < len; j++) { + for (unsigned j = 0; j < len; j++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); @@ -1308,10 +1308,8 @@ static int ivr_read_header(AVFormatContext *s) if (ret < 0) return ret; } else if (type == 4) { - int j; - av_log(s, AV_LOG_DEBUG, "%s = '0x", key); - for (j = 0; j < len; j++) { + for (unsigned j = 0; j < len; j++) { if (avio_feof(pb)) return AVERROR_INVALIDDATA; av_log(s, AV_LOG_DEBUG, "%X", avio_r8(pb)); -- 2.52.0 >From 80232f6ecd8874097f583e920b95a1caef1ffd59 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:06:18 +0200 Subject: [PATCH 19/28] avfilter/vf_super2xsai: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavfilter/vf_super2xsai.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c index cf3aaebd64..ef75b4dc73 100644 --- a/libavfilter/vf_super2xsai.c +++ b/libavfilter/vf_super2xsai.c @@ -271,6 +271,7 @@ static int config_input(AVFilterLink *inlink) case AV_PIX_FMT_RGB565BE: case AV_PIX_FMT_BGR565BE: s->is_be = 1; + av_fallthrough; case AV_PIX_FMT_RGB565LE: case AV_PIX_FMT_BGR565LE: s->hi_pixel_mask = 0xF7DEF7DE; @@ -283,6 +284,7 @@ static int config_input(AVFilterLink *inlink) case AV_PIX_FMT_BGR555BE: case AV_PIX_FMT_RGB555BE: s->is_be = 1; + av_fallthrough; case AV_PIX_FMT_BGR555LE: case AV_PIX_FMT_RGB555LE: s->hi_pixel_mask = 0x7BDE7BDE; -- 2.52.0 >From 4215c6c2a8d432774beb078df48dae069ab0fe26 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:09:02 +0200 Subject: [PATCH 20/28] avfilter/vf_stereo3d: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavfilter/vf_stereo3d.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c index da0681077f..e84af47f4d 100644 --- a/libavfilter/vf_stereo3d.c +++ b/libavfilter/vf_stereo3d.c @@ -414,24 +414,28 @@ static int config_output(AVFilterLink *outlink) switch (s->in.format) { case SIDE_BY_SIDE_2_LR: s->aspect.num *= 2; + av_fallthrough; case SIDE_BY_SIDE_LR: s->width = inlink->w / 2; s->in.off_right = s->width; break; case SIDE_BY_SIDE_2_RL: s->aspect.num *= 2; + av_fallthrough; case SIDE_BY_SIDE_RL: s->width = inlink->w / 2; s->in.off_left = s->width; break; case ABOVE_BELOW_2_LR: s->aspect.den *= 2; + av_fallthrough; case ABOVE_BELOW_LR: s->in.row_right = s->height = inlink->h / 2; break; case ABOVE_BELOW_2_RL: s->aspect.den *= 2; + av_fallthrough; case ABOVE_BELOW_RL: s->in.row_left = s->height = inlink->h / 2; @@ -496,18 +500,21 @@ static int config_output(AVFilterLink *outlink) } case SIDE_BY_SIDE_2_LR: s->aspect.den *= 2; + av_fallthrough; case SIDE_BY_SIDE_LR: s->out.width = s->width * 2; s->out.off_right = s->width; break; case SIDE_BY_SIDE_2_RL: s->aspect.den *= 2; + av_fallthrough; case SIDE_BY_SIDE_RL: s->out.width = s->width * 2; s->out.off_left = s->width; break; case ABOVE_BELOW_2_LR: s->aspect.num *= 2; + av_fallthrough; case ABOVE_BELOW_LR: s->out.height = s->height * 2; s->out.row_right = s->height; @@ -524,6 +531,7 @@ static int config_output(AVFilterLink *outlink) break; case ABOVE_BELOW_2_RL: s->aspect.num *= 2; + av_fallthrough; case ABOVE_BELOW_RL: s->out.height = s->height * 2; s->out.row_left = s->height; @@ -805,6 +813,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) oleft->linesize[i] *= 2; oright->linesize[i] *= 2; } + av_fallthrough; case ABOVE_BELOW_LR: case ABOVE_BELOW_RL: case ABOVE_BELOW_2_LR: @@ -836,6 +845,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref) for (j = h; j < h + b; j++) memset(oleft->data[i] + j * s->linesize[i], 0, s->linesize[i]); } + av_fallthrough; case SIDE_BY_SIDE_LR: case SIDE_BY_SIDE_RL: case SIDE_BY_SIDE_2_LR: @@ -872,6 +882,7 @@ copy: break; case MONO_L: iright = ileft; + av_fallthrough; case MONO_R: switch (s->in.format) { case INTERLEAVE_ROWS_LR: @@ -879,6 +890,7 @@ copy: for (i = 0; i < s->nb_planes; i++) { out->linesize[i] *= 2; } + av_fallthrough; case ABOVE_BELOW_LR: case ABOVE_BELOW_RL: case ABOVE_BELOW_2_LR: -- 2.52.0 >From aabd0b13427164da796fa429c535b73883fcf4ef Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:15:22 +0200 Subject: [PATCH 21/28] avcodec/libaomenc: Use av_fallthrough to mark fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libaomenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 20e97e5d43..48ba4e1a9d 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -475,7 +475,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, switch (avctx->pix_fmt) { case AV_PIX_FMT_GRAY8: enccfg->monochrome = 1; - /* Fall-through */ + av_fallthrough; case AV_PIX_FMT_YUV420P: enccfg->g_profile = AV_PROFILE_AV1_MAIN; *img_fmt = AOM_IMG_FMT_I420; @@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps, case AV_PIX_FMT_GRAY10: case AV_PIX_FMT_GRAY12: enccfg->monochrome = 1; - /* Fall-through */ + av_fallthrough; case AV_PIX_FMT_YUV420P10: case AV_PIX_FMT_YUV420P12: if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { -- 2.52.0 >From ae11b9eb59d0dd0d16f2e467f5886c16f140b65a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:16:11 +0200 Subject: [PATCH 22/28] avcodec/libopusenc: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libopusenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index fb4a05a99e..394911ff36 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -287,6 +287,7 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) /* Frame sizes less than 10 ms can only use MDCT mode, so switching to * RESTRICTED_LOWDELAY avoids an unnecessary extra 2.5ms lookahead. */ opus->opts.application = OPUS_APPLICATION_RESTRICTED_LOWDELAY; + av_fallthrough; case 480: case 960: case 1920: -- 2.52.0 >From b2ea508dbf6e4402e65b5b2782fc6cfdc1540a68 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:17:52 +0200 Subject: [PATCH 23/28] avcodec/libvpxenc: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libvpxenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index c181927a1d..b21ba175ab 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -836,6 +836,7 @@ static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps, case AV_PIX_FMT_GBRP: case AV_PIX_FMT_GBRAP: ctx->vpx_cs = VPX_CS_SRGB; + av_fallthrough; case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_YUVA444P: if (avctx->colorspace == AVCOL_SPC_RGB) @@ -877,6 +878,7 @@ static int set_pix_fmt(AVCodecContext *avctx, vpx_codec_caps_t codec_caps, case AV_PIX_FMT_GBRP12: case AV_PIX_FMT_GBRAP12: ctx->vpx_cs = VPX_CS_SRGB; + av_fallthrough; case AV_PIX_FMT_YUV444P10: case AV_PIX_FMT_YUVA444P10: case AV_PIX_FMT_YUV444P12: -- 2.52.0 >From d5cdb935d532437939ddba2cf195b24712e1e9ac Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:18:03 +0200 Subject: [PATCH 24/28] avcodec/libxavs2: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libxavs2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index d7583e8b67..69d8219c54 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -195,6 +195,7 @@ static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, xavs2_copy_frame(&pic, frame); break; } + av_fallthrough; default: av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n"); return AVERROR(EINVAL); -- 2.52.0 >From aae28a255bedb8e06f52699039b245b6ab917671 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:19:57 +0200 Subject: [PATCH 25/28] avcodec/libxvid: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libxvid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 94c521313b..6bd64a3482 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -407,12 +407,14 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) case 5: x->me_flags |= XVID_ME_EXTSEARCH16 | XVID_ME_EXTSEARCH8; + av_fallthrough; case 4: case 3: x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 | XVID_ME_HALFPELREFINE8 | XVID_ME_CHROMA_PVOP | XVID_ME_CHROMA_BVOP; + av_fallthrough; case 2: case 1: x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 | @@ -427,11 +429,13 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) XVID_ME_QUARTERPELREFINE8_RD | XVID_ME_EXTSEARCH_RD | XVID_ME_CHECKPREDICTION_RD; + av_fallthrough; case FF_MB_DECISION_BITS: if (!(x->vop_flags & XVID_VOP_MODEDECISION_RD)) x->vop_flags |= XVID_VOP_FAST_MODEDECISION_RD; x->me_flags |= XVID_ME_HALFPELREFINE16_RD | XVID_ME_QUARTERPELREFINE16_RD; + av_fallthrough; default: break; } -- 2.52.0 >From 7bb80717a9aafb9bf763cb83a3e5b5572eaa437b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:20:43 +0200 Subject: [PATCH 26/28] avcodec/libzvbi-teletextdec: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/libzvbi-teletextdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index e02ecb8b3a..06fd54cbb7 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -428,6 +428,7 @@ static void fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi case VBI_OPAQUE: if (!ctx->transparent_bg) break; + av_fallthrough; case VBI_SEMI_TRANSPARENT: if (ctx->opacity > 0) { if (ctx->opacity < 255) @@ -436,6 +437,7 @@ static void fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi *pixel += VBI_NB_COLORS; break; } + av_fallthrough; case VBI_TRANSPARENT_FULL: for(; pixel < pixelnext; pixel++) if (*pixel == vc->background) -- 2.52.0 >From 4ccf63ef2ac8b5277407113d4938136c4979c0f0 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:22:05 +0200 Subject: [PATCH 27/28] avcodec/nvenc: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/nvenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 8c028153c7..a8dac1ebd3 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -2781,6 +2781,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur switch (lock_params.pictureType) { case NV_ENC_PIC_TYPE_IDR: pkt->flags |= AV_PKT_FLAG_KEY; + av_fallthrough; case NV_ENC_PIC_TYPE_I: pict_type = AV_PICTURE_TYPE_I; break; -- 2.52.0 >From c097f82f622c9775ab15ca34c9c9e037efe492b7 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <[email protected]> Date: Tue, 28 Apr 2026 21:22:59 +0200 Subject: [PATCH 28/28] avcodec/qsvenc: Add av_fallthrough Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/qsvenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index fc1b8795d8..0e957d1b91 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -904,6 +904,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) if (q->extbrc) { q->extco2.LookAheadDepth = q->look_ahead_depth; } + av_fallthrough; #if QSV_HAVE_VCM case MFX_RATECONTROL_VCM: #endif @@ -949,6 +950,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q) break; case MFX_RATECONTROL_LA_ICQ: q->extco2.LookAheadDepth = q->look_ahead_depth; + av_fallthrough; case MFX_RATECONTROL_ICQ: q->param.mfx.ICQQuality = av_clip(avctx->global_quality, 1, 51); break; -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
