Compare commits

...

5 Commits

Author SHA1 Message Date
Andreas Rheinhardt 57d6898730 configure: Only test for SSE2 intrinsics on x86
Reviewed-by: Kieran Kunhya <kieran@kunhya.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-11-17 10:36:54 +01:00
Artem Smorodin e94439e49b avformat/tee: fix the default onfail setting of the tee salves
I found that the default value is not set for onfail option. I see that there is an attempt to set this value by default inside parse_slave_failure_policy_option. But look at the CONSUME_OPTION macro. If av_dict_get cannot find this option, then this function is not even called.
2025-11-17 00:01:42 +00:00
Michael Niedermayer 88b676105d
avcodec/prores_raw: Check bits in get_value()
The code loads 32bit so we can at maximum use 32bit

the return type is also changed to uint16_t (was requested in review),

no path is known where a return value above 32767 is produced, but that was not exhaustively checked

Fixes: runtime error: shift exponent -9 is negative
Fixes: 439483046/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_RAW_DEC_fuzzer-6649466540326912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-16 21:43:17 +01:00
Michael Niedermayer 9ccc33d84d
avcodec/prores_raw: Prettify ff_prores_raw_*_cb
the values contain 3 4 bit values, thus using hex is more natural
and shows more information

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-16 21:34:38 +01:00
Michael Niedermayer ad956ff076
avfilter/vf_drawtext: Account for bbox text seperator
Fixes: out of array access
no test case

Found-by: Joshua Rogers <joshua@joshua.hu> with ZeroPath
Reviewed-by: Joshua Rogers <joshua@joshua.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-11-16 20:32:11 +01:00
4 changed files with 21 additions and 16 deletions

3
configure vendored
View File

@ -6675,13 +6675,14 @@ EOF
;;
esac
check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()"
elif enabled loongarch; then
enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
fi
check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()"
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack

View File

@ -59,7 +59,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
static int16_t get_value(GetBitContext *gb, int16_t codebook)
static uint16_t get_value(GetBitContext *gb, int16_t codebook)
{
const int16_t switch_bits = codebook >> 8;
const int16_t rice_order = codebook & 0xf;
@ -83,6 +83,8 @@ static int16_t get_value(GetBitContext *gb, int16_t codebook)
}
bits = exp_order + (q << 1) - switch_bits;
if (bits > 32)
return 0; // we do not return a negative error code so that we dont produce out of range values on errors
skip_bits_long(gb, bits);
return (b >> (32 - bits)) +
((switch_bits + 1) << rice_order) -
@ -97,30 +99,30 @@ static const uint8_t align_tile_w[16] = {
#define DC_CB_MAX 12
const uint8_t ff_prores_raw_dc_cb[DC_CB_MAX + 1] = {
16, 33, 50, 51, 51, 51, 68, 68, 68, 68, 68, 68, 118,
0x010, 0x021, 0x032, 0x033, 0x033, 0x033, 0x044, 0x044, 0x044, 0x044, 0x044, 0x044, 0x076,
};
#define AC_CB_MAX 94
const int16_t ff_prores_raw_ac_cb[AC_CB_MAX + 1] = {
0, 529, 273, 273, 546, 546, 546, 290, 290, 290, 563, 563,
563, 563, 563, 563, 563, 563, 307, 307, 580, 580, 580, 580,
580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580, 580,
580, 580, 580, 580, 580, 580, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
853, 853, 853, 853, 853, 853, 853, 853, 853, 853, 358
0x000, 0x211, 0x111, 0x111, 0x222, 0x222, 0x222, 0x122, 0x122, 0x122,
0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x133, 0x133,
0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244,
0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244, 0x244,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355,
0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x355, 0x166,
};
#define RN_CB_MAX 27
const int16_t ff_prores_raw_rn_cb[RN_CB_MAX + 1] = {
512, 256, 0, 0, 529, 529, 273, 273, 17, 17, 33, 33, 546,
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 50, 50, 68,
0x200, 0x100, 0x000, 0x000, 0x211, 0x211, 0x111, 0x111, 0x011, 0x011, 0x021, 0x021, 0x222, 0x022,
0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x022, 0x032, 0x032, 0x044
};
#define LN_CB_MAX 14
const int16_t ff_prores_raw_ln_cb[LN_CB_MAX + 1] = {
256, 273, 546, 546, 290, 290, 1075, 1075, 563, 563, 563, 563, 563, 563, 51
0x100, 0x111, 0x222, 0x222, 0x122, 0x122, 0x433, 0x433, 0x233, 0x233, 0x233, 0x233, 0x233, 0x233, 0x033,
};
static int decode_comp(AVCodecContext *avctx, TileContext *tile,
@ -145,7 +147,7 @@ static int decode_comp(AVCodecContext *avctx, TileContext *tile,
int16_t dc_add = 0;
int16_t dc_codebook;
int16_t ac, rn, ln;
uint16_t ac, rn, ln;
int16_t ac_codebook = 49;
int16_t rn_codebook = 0;
int16_t ln_codebook = 66;

View File

@ -1011,7 +1011,7 @@ static av_cold int init(AVFilterContext *ctx)
av_log(ctx, AV_LOG_WARNING, "Multiple texts provided, will use text_source only\n");
av_free(s->text);
}
s->text = av_mallocz(AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE *
s->text = av_mallocz((AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE + 1) *
(AV_NUM_DETECTION_BBOX_CLASSIFY + 1));
if (!s->text)
return AVERROR(ENOMEM);

View File

@ -167,6 +167,8 @@ static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
if ((ret = ff_tee_parse_slave_options(avf, slave, &options, &filename)) < 0)
return ret;
tee_slave->on_fail = DEFAULT_SLAVE_FAILURE_POLICY;
#define CONSUME_OPTION(option, field, action) do { \
AVDictionaryEntry *en = av_dict_get(options, option, NULL, 0); \
if (en) { \