[FFmpeg-cvslog] avcodec/jpegxl_parse{,r}: use correct ISOBMFF extended size location
ffmpeg | branch: master | Leo Izen | Mon Nov 27 09:10:06 2023 -0500| [019b3ea65aee78cb68ee94beb37dab1bba5d2aa6] | committer: Leo Izen avcodec/jpegxl_parse{,r}: use correct ISOBMFF extended size location According to ISO/IEC 14996-12, size == 1 means a 64-bit extended-size field occurs *after* the 32-bit box type, not before. This fix should allow correct parsing of JXL files with extended-size boxes. Signed-off-by: Leo Izen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=019b3ea65aee78cb68ee94beb37dab1bba5d2aa6 --- libavcodec/jpegxl_parse.c | 6 +++--- libavcodec/jpegxl_parser.c | 9 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/jpegxl_parse.c b/libavcodec/jpegxl_parse.c index eb28e80867..7cfdd3e7d5 100644 --- a/libavcodec/jpegxl_parse.c +++ b/libavcodec/jpegxl_parse.c @@ -462,8 +462,10 @@ int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_l return AVERROR_BUFFER_TOO_SMALL; size = bytestream2_get_be32(&gb); +tag = bytestream2_get_le32(&gb); + if (size == 1) { -if (bytestream2_get_bytes_left(&gb) < 12) +if (bytestream2_get_bytes_left(&gb) < 8) return AVERROR_BUFFER_TOO_SMALL; size = bytestream2_get_be64(&gb); head_size = 16; @@ -474,8 +476,6 @@ int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_l if (size) size -= head_size; -tag = bytestream2_get_le32(&gb); - if (tag == MKTAG('j','x','l','p')) { uint32_t idx; if (bytestream2_get_bytes_left(&gb) < 4) diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c index 630fc8a60b..750872f17f 100644 --- a/libavcodec/jpegxl_parser.c +++ b/libavcodec/jpegxl_parser.c @@ -1342,7 +1342,7 @@ static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size) while (1) { uint64_t size; -int head_size = 4; +int head_size = 8; if (bytestream2_peek_le16(&gb) == FF_JPEGXL_CODESTREAM_SIGNATURE_LE) break; @@ -1353,16 +1353,17 @@ static int skip_boxes(JXLParseContext *ctx, const uint8_t *buf, int buf_size) return AVERROR_BUFFER_TOO_SMALL; size = bytestream2_get_be32(&gb); +bytestream2_skip(&gb, 4); // tag if (size == 1) { -if (bytestream2_get_bytes_left(&gb) < 12) +if (bytestream2_get_bytes_left(&gb) < 8) return AVERROR_BUFFER_TOO_SMALL; size = bytestream2_get_be64(&gb); -head_size = 12; +head_size = 16; } if (!size) return AVERROR_INVALIDDATA; /* invalid ISOBMFF size */ -if (size <= head_size + 4 || size > INT_MAX - ctx->skip) +if (size <= head_size || size > INT_MAX - ctx->skip) return AVERROR_INVALIDDATA; ctx->skip += size; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/jpegxl_parser: fix parsing sequences of extremely small files
ffmpeg | branch: master | Leo Izen | Mon Nov 27 09:10:07 2023 -0500| [c4be080e65a37cac5ef8ce6ba7a9e1a59cb9b7dd] | committer: Leo Izen avcodec/jpegxl_parser: fix parsing sequences of extremely small files This patch allows the JXL parser to parse sequences of extremely small files concatenated together. (e.g. smaller than the parser buffer) Signed-off-by: Leo Izen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4be080e65a37cac5ef8ce6ba7a9e1a59cb9b7dd --- libavcodec/jpegxl_parser.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavcodec/jpegxl_parser.c b/libavcodec/jpegxl_parser.c index 750872f17f..006eb6b295 100644 --- a/libavcodec/jpegxl_parser.c +++ b/libavcodec/jpegxl_parser.c @@ -1454,15 +1454,21 @@ static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, { JXLParseContext *ctx = s->priv_data; int next = END_NOT_FOUND, ret; +const uint8_t *pbuf = ctx->pc.buffer; +int pindex = ctx->pc.index; *poutbuf_size = 0; *poutbuf = NULL; -if (!ctx->pc.index) -goto flush; +if (!ctx->pc.index) { +if (ctx->pc.overread) +goto flush; +pbuf = buf; +pindex = buf_size; +} if ((!ctx->container || !ctx->codestream_length) && !ctx->next) { -ret = try_parse(s, avctx, ctx, ctx->pc.buffer, ctx->pc.index); +ret = try_parse(s, avctx, ctx, pbuf, pindex); if (ret < 0) goto flush; ctx->next = ret; @@ -1471,7 +1477,7 @@ static int jpegxl_parse(AVCodecParserContext *s, AVCodecContext *avctx, } if (ctx->container && ctx->next >= 0) { -ret = skip_boxes(ctx, ctx->pc.buffer, ctx->pc.index); +ret = skip_boxes(ctx, pbuf, pindex); if (ret < 0) { if (ret == AVERROR_INVALIDDATA) ctx->next = -1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] fate/jpegxl: add parser test for extboxes and small files
ffmpeg | branch: master | Leo Izen | Mon Nov 27 09:10:08 2023 -0500| [b60d39fbe2b30225e504ea9e0dc8c30c78683c90] | committer: Leo Izen fate/jpegxl: add parser test for extboxes and small files Add a fate test for the above commits fixing extremely small files or files with extended box sizes. Signed-off-by: Leo Izen > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b60d39fbe2b30225e504ea9e0dc8c30c78683c90 --- tests/fate/jxl.mak | 8 tests/ref/fate/jxl-small-ext-box | 9 + 2 files changed, 17 insertions(+) diff --git a/tests/fate/jxl.mak b/tests/fate/jxl.mak index 057d3be0e1..d653eb644a 100644 --- a/tests/fate/jxl.mak +++ b/tests/fate/jxl.mak @@ -14,3 +14,11 @@ FATE_JPEGXL_ANIM_DEMUX += $(FATE_JPEGXL_ANIM_DEMUX-yes) FATE_SAMPLES_FFMPEG-$(call FRAMECRC, JPEGXL_ANIM) += $(FATE_JPEGXL_ANIM_DEMUX) fate-jxl-anim-demux: $(FATE_JPEGXL_ANIM_DEMUX) + +# parser tests +FATE_JPEGXL_PARSE += fate-jxl-small-ext-box +fate-jxl-small-ext-box: CMD = framecrc -i $(TARGET_SAMPLES)/jxl/l.jxl -c copy + +FATE_JPEGXL_PARSE += $(FATE_JPEGXL_PARSE-yes) +FATE_SAMPLES_FFMPEG-$(call FRAMECRC, IMAGE_JPEGXL_PIPE, , JPEGXL_PARSER) += $(FATE_JPEGXL_PARSE) +fate-jxl-parse: $(FATE_JPEGXL_PARSE) diff --git a/tests/ref/fate/jxl-small-ext-box b/tests/ref/fate/jxl-small-ext-box new file mode 100644 index 00..0f9adfe075 --- /dev/null +++ b/tests/ref/fate/jxl-small-ext-box @@ -0,0 +1,9 @@ +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: jpegxl +#dimensions 0: 8x8 +#sar 0: 0/1 +0, 0, 0,1, 104, 0xd12d1d10 +0, 1, 1,1, 104, 0xd12d1d10 +0, 2, 2,1, 104, 0xd12d1d10 +0, 3, 3,1, 104, 0xd12d1d10 ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/mov: Ignore duplicate ftyp
ffmpeg | branch: master | Michael Niedermayer | Sat Dec 2 00:26:03 2023 +0100| [4cdf2c7f768015c74078544d153f243b6d9b9ac5] | committer: Michael Niedermayer avformat/mov: Ignore duplicate ftyp Fixes: switch_1080p_720p.mp4 Found-by: Dale Curtis Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cdf2c7f768015c74078544d153f243b6d9b9ac5 --- libavformat/mov.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index f7b5ec7a35..30cf7a15b0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1222,8 +1222,12 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) int ret = ffio_read_size(pb, type, 4); if (ret < 0) return ret; -if (c->fc->nb_streams) -return AVERROR_INVALIDDATA; +if (c->fc->nb_streams) { +if (c->fc->strict_std_compliance >= FF_COMPLIANCE_STRICT) +return AVERROR_INVALIDDATA; +av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate FTYP\n"); +return 0; +} if (strcmp(type, "qt ")) c->isom = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/av1dec: Fix resolving zero divisor
ffmpeg | branch: master | Michael Niedermayer | Thu Nov 30 02:36:41 2023 +0100| [22daf2148fc072f8f347af939f88b3af7896ab60] | committer: Michael Niedermayer avcodec/av1dec: Fix resolving zero divisor Fixes: Out of array read Fixes: global-buffer-overflow-AV1 Found-by: "Leonelli, Matteo" Tested-by: "Wang, Fei W" Reviewed-by: "Wang, Fei W" Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22daf2148fc072f8f347af939f88b3af7896ab60 --- libavcodec/av1dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 6114cb78e6..4dcde234c6 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -177,7 +177,7 @@ static uint8_t get_shear_params_valid(AV1DecContext *s, int idx) int16_t alpha, beta, gamma, delta, divf, divs; int64_t v, w; int32_t *param = &s->cur_frame.gm_params[idx][0]; -if (param[2] < 0) +if (param[2] <= 0) return 0; alpha = av_clip_int16(param[2] - (1 << AV1_WARPEDMODEL_PREC_BITS)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] doc/developer: require asm for RISC-V
ffmpeg | branch: master | Jean-Baptiste Kempf | Tue Dec 5 10:56:55 2023 +0100| [6e26a5a64e123535026e2266ae039baed72f35d6] | committer: J. Dekker doc/developer: require asm for RISC-V Explicitly document our usage of assembly, following suit with other architectures. Signed-off-by: J. Dekker > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e26a5a64e123535026e2266ae039baed72f35d6 --- doc/developer.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/developer.texi b/doc/developer.texi index 26dc5b9749..eed0ee4915 100644 --- a/doc/developer.texi +++ b/doc/developer.texi @@ -99,7 +99,7 @@ The specific syntax used for writing assembly is: NASM on x86; @item -GAS on ARM. +GAS on ARM and RISC-V. @end itemize A unit testing framework for assembly called @code{checkasm} lives under ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/qoadec: fix overreads and fix packet size check
ffmpeg | branch: master | Paul B Mahol | Tue Dec 5 14:46:26 2023 +0100| [7e453dad3c776768ec71ac4a65c2859bb660c498] | committer: Paul B Mahol avcodec/qoadec: fix overreads and fix packet size check > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e453dad3c776768ec71ac4a65c2859bb660c498 --- libavcodec/qoadec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/qoadec.c b/libavcodec/qoadec.c index 443f42a527..75099d1199 100644 --- a/libavcodec/qoadec.c +++ b/libavcodec/qoadec.c @@ -110,8 +110,8 @@ static int qoa_decode_frame(AVCodecContext *avctx, AVFrame *frame, if (frame_size > avpkt->size) return AVERROR_INVALIDDATA; -if (frame_size < 8 + QOA_LMS_LEN * 4 * nb_channels + -8LL * frame->nb_samples * nb_channels / QOA_SLICE_LEN) +if (avpkt->size < 8 + QOA_LMS_LEN * 4 * nb_channels + +8LL * ((frame->nb_samples + QOA_SLICE_LEN - 1) / QOA_SLICE_LEN) * nb_channels) return AVERROR_INVALIDDATA; if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) @@ -127,7 +127,7 @@ static int qoa_decode_frame(AVCodecContext *avctx, AVFrame *frame, qch->weights[n] = sign_extend(bytestream2_get_be16u(&gb), 16); } -for (int sample_index = 0; sample_index < frame->nb_samples * nb_channels; +for (int sample_index = 0; sample_index < frame->nb_samples; sample_index += QOA_SLICE_LEN) { for (int ch = 0; ch < nb_channels; ch++) { QOAChannel *lms = &s->ch[ch]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] tests/fate: add asegment filter tests
ffmpeg | branch: master | Paul B Mahol | Mon Dec 4 16:06:02 2023 +0100| [3047f05a99a9189cfdcc8d904cd2bd15aaa1f162] | committer: Paul B Mahol tests/fate: add asegment filter tests > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3047f05a99a9189cfdcc8d904cd2bd15aaa1f162 --- tests/fate/filter-audio.mak| 17 ++ tests/ref/fate/filter-asegment-samples-absolute| 274 tests/ref/fate/filter-asegment-samples-relative| 274 tests/ref/fate/filter-asegment-timestamps-absolute | 275 + tests/ref/fate/filter-asegment-timestamps-relative | 275 + 5 files changed, 1115 insertions(+) diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak index 445c0f9217..adf61cf074 100644 --- a/tests/fate/filter-audio.mak +++ b/tests/fate/filter-audio.mak @@ -271,6 +271,23 @@ $(FATE_ATRIM): SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav FATE_AFILTER-$(call FILTERDEMDECENCMUX, ATRIM, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_ATRIM) +FATE_ASEGMENT += fate-filter-asegment-samples-absolute +fate-filter-asegment-samples-absolute: CMD = framecrc -i $(SRC) -lavfi asegment=samples="1|2" + +FATE_ASEGMENT += fate-filter-asegment-samples-relative +fate-filter-asegment-samples-relative: CMD = framecrc -i $(SRC) -lavfi asegment=samples="1|+1" + +FATE_ASEGMENT += fate-filter-asegment-timestamps-absolute +fate-filter-asegment-timestamps-absolute: CMD = framecrc -i $(SRC) -lavfi asegment=timestamps="1|3" + +FATE_ASEGMENT += fate-filter-asegment-timestamps-relative +fate-filter-asegment-timestamps-relative: CMD = framecrc -i $(SRC) -lavfi asegment=timestamps="1|+2" + +$(FATE_ASEGMENT): tests/data/asynth-44100-2.wav +$(FATE_ASEGMENT): SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav + +FATE_AFILTER-$(call FILTERDEMDECENCMUX, ASEGMENT, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_ASEGMENT) + FATE_FILTER_CHANNELMAP += fate-filter-channelmap-one-int fate-filter-channelmap-one-int: tests/data/filtergraphs/channelmap_one_int fate-filter-channelmap-one-int: SRC = $(TARGET_PATH)/tests/data/asynth-44100-6.wav diff --git a/tests/ref/fate/filter-asegment-samples-absolute b/tests/ref/fate/filter-asegment-samples-absolute new file mode 100644 index 00..69d4013f5f --- /dev/null +++ b/tests/ref/fate/filter-asegment-samples-absolute @@ -0,0 +1,274 @@ +#tb 0: 1/44100 +#media_type 0: audio +#codec_id 0: pcm_s16le +#sample_rate 0: 44100 +#channel_layout_name 0: stereo +#tb 1: 1/44100 +#media_type 1: audio +#codec_id 1: pcm_s16le +#sample_rate 1: 44100 +#channel_layout_name 1: stereo +#tb 2: 1/44100 +#media_type 2: audio +#codec_id 2: pcm_s16le +#sample_rate 2: 44100 +#channel_layout_name 2: stereo +0, 0, 0, 1024, 4096, 0x29e3eecf +0, 1024, 1024, 1024, 4096, 0x18390b96 +0, 2048, 2048, 1024, 4096, 0xc477fa99 +0, 3072, 3072, 1024, 4096, 0x3bc0f14f +0, 4096, 4096, 1024, 4096, 0x2379ed91 +0, 5120, 5120, 1024, 4096, 0xfd6a0070 +0, 6144, 6144, 1024, 4096, 0x0b01f4cf +0, 7168, 7168, 1024, 4096, 0x6716fd93 +0, 8192, 8192, 1024, 4096, 0x1840f25b +0, 9216, 9216, 784, 3136, 0x048e2dc2 +1, 1, 1, 1264, 5056, 0x7265bced +1, 11264, 11264, 1024, 4096, 0x3e050390 +1, 12288, 12288, 1024, 4096, 0xb30e0090 +1, 13312, 13312, 1024, 4096, 0x26b8f75b +1, 14336, 14336, 1024, 4096, 0xd706e311 +1, 15360, 15360, 1024, 4096, 0x0c480138 +1, 16384, 16384, 1024, 4096, 0x6c9a0216 +1, 17408, 17408, 1024, 4096, 0x7abce54f +1, 18432, 18432, 1024, 4096, 0xda45f63f +1, 19456, 19456, 544, 2176, 0x3b54483e +2, 2, 2, 1504, 6016, 0xba58ba9b +2, 21504, 21504, 1024, 4096, 0xa61af077 +2, 22528, 22528, 1024, 4096, 0x84c4fc07 +2, 23552, 23552, 1024, 4096, 0x4a35f345 +2, 24576, 24576, 1024, 4096, 0xbb65fa81 +2, 25600, 25600, 1024, 4096, 0xf6c7f5e5 +2, 26624, 26624, 1024, 4096, 0xd3270138 +2, 27648, 27648, 1024, 4096, 0x4782ed53 +2, 28672, 28672, 1024, 4096, 0xe308f055 +2, 29696, 29696, 1024, 4096, 0x7d33f97d +2, 30720, 30720, 1024, 4096, 0xb8b00dd4 +2, 31744, 31744, 1024, 4096, 0x7ff7efab +2, 32768, 32768, 1024, 4096, 0x29e3eecf +2, 33792, 33792, 1024, 4096, 0x18390b96 +2, 34816, 34816, 1024, 4096, 0xc477fa99 +2, 35840, 35840, 1024, 4096, 0x3bc0f14f +2, 36864, 36864, 1024, 4096, 0x2379ed91 +2, 37888, 37888, 1024, 4096,
[FFmpeg-cvslog] MAINTAINERS: add myself as vvc maintainer
ffmpeg | branch: master | Nuo Mi | Tue Dec 5 23:16:09 2023 +0800| [e78c6a1f2c9e46e36017654bc56c0b993cf6510e] | committer: Thilo Borgmann MAINTAINERS: add myself as vvc maintainer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e78c6a1f2c9e46e36017654bc56c0b993cf6510e --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3430e1722b..57137e1d6d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -257,6 +257,7 @@ Codecs: vp8 David Conrad, Ronald Bultje vp9 Ronald Bultje vqavideo.cMike Melanson + vvc Nuo Mi wmaprodec.c Sascha Sommer wmavoice.cRonald S. Bultje wmv2.cMichael Niedermayer ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".