Commit Graph

111653 Commits

Author SHA1 Message Date
Andreas Rheinhardt
bf9f6a5e55 avformat/lrcdec: Fix declaration-after-statement warning
Happens since c0f867bf50.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-29 17:58:58 +02:00
Paul B Mahol
37d3000e3e avfilter/avf_showcwt: fix truncation of low Hz kernels 2023-07-29 17:16:42 +02:00
Reimar Döffinger
c0f867bf50 libavformat: fix incorrect handling of incomplete AVBPrint.
Change some internal APIs a bit to make it harder to make
such mistakes.
In particular, have the read chunk functions return an error
when the result is incomplete.
This might be less flexible, but since there has been no
use-case for that so far, avoiding coding mistakes seems better.
Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bprint).
Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2023-07-29 16:05:29 +02:00
Reimar Döffinger
dcff15692d hevcdsp_idct_neon.S: Avoid unnecessary mov.
ret can be given an argument instead.
This is also consistent with how other assembler code
in FFmpeg does it.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2023-07-29 16:05:23 +02:00
James Almer
075dfc271b avfilter/qsvvpp: remove usage of deprecated fields
Added by mistake in 88b3841149.

Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-29 09:25:58 -03:00
Paul B Mahol
44813d66e2 avfilter/avf_showcwt: make kernels symmetrical 2023-07-29 11:30:16 +02:00
Paul B Mahol
6f6907fd20 avfilter/avf_showcwt: fix very low freqs leakage 2023-07-29 11:30:16 +02:00
Andreas Rheinhardt
27b4364339 avcodec/fdctdsp: Mark functions as hidden
Pointers to these functions are used in comparisons.
Currently the compiler has to presume the worst for these,
namely that the functions are from another DSO and therefore
loads their addresses from the GOT (which also entails a
relocation entry that is processed at runtime, regardless
of whether the code using them is run or not). This changes
after these functions are declared as hidden.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-29 04:22:01 +02:00
Andreas Rheinhardt
8387241975 avcodec/dct: Move fdct function declarations to fdctdsp.h
It is the more proper place for them given that this is
the only API using them.
Also use a forward-declaration of AVCodecContext in fdctdsp.h
to avoid including avcodec.h in jfdct(fst|int).c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-29 04:16:59 +02:00
Andreas Rheinhardt
096563c108 avcodec/Makefile: Unconditionally skip vulkan_video_codec_av1std.h
libavcodec/vulkan_video_codec_av1std.h currently does not pass
checkheaders: It is missing stdint.h and vulkan/vulkan_core.h.
The comment "This header is NOT YET generated from the Khronos Vulkan
XML API Registry." as well as the fact that it does not use our standard
inclusion guards makes the file appear as if it is to be treated
like a third-party header and not one of our own. This commit
therefore "fixes" the issue by unconditionally skipping said header.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-29 04:06:58 +02:00
Paul B Mahol
8c67e13473 avfilter/avf_showcwt: remove not needed fabsf() 2023-07-28 22:32:31 +02:00
Paul B Mahol
7d6dd90f3a avfilter/avf_showcwt: unbreak highest frequencies
The kernel was truncated too much.
2023-07-28 22:32:31 +02:00
Paul B Mahol
dca54600f0 avfilter/avf_showcwt: keep kernels precision as high as possible 2023-07-28 22:32:31 +02:00
Jan Ekström
b300552dfb avformat/mov: enable identifying TTML subtitle streams as such
The contents are full TTML XML documents. TTML writing tests'
results are updated as the streams are now properly identified
as TTML ones.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2023-07-28 15:31:56 +03:00
Sebastian Ramacher
7de3fcb059 examples: fix build of mux and resample_audio
The commits eac4324bfb and
cd8211527e renamed the examples, but the
targets were not updated. Hence, the builds are missing -lm.

Signed-off-by: Sebastian Ramacher <sramacher@debian.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-28 09:20:39 -03:00
Anton Khirnov
e8777221f2 fftools/ffprobe: fix handling parse_options() return value
Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-28 09:11:26 -03:00
Paul B Mahol
a7a46aff46 avfilter/avf_showcwt: remove excessive operations 2023-07-28 14:02:35 +02:00
Paul B Mahol
32a2268b6e avfilter/avf_showcwt: switch to overlap-save
And do both left and right zero-padding for forward FFT.
2023-07-28 14:02:34 +02:00
Paul B Mahol
830e522cde avfilter/avf_showcwt: reduce memory usage even more 2023-07-28 14:02:33 +02:00
Benjamin Cheng
27804200ef vulkan_hevc: use diagonal scan order for scaling lists
The hevc parser parses the diagonal scan order in bitstream into raster
scan order. However, the Vulkan spec wants it as specified in H265 spec,
which is diagonal scan order.

Tested on RADV.

v2: fix copy-paste typo with PPS.
2023-07-28 04:07:33 +02:00
Michael Niedermayer
cf9cd35aa9
avcodec/evc_ps: Check num_ref_pic_list_in_sps
Fixes: out of array write
Fixes: 60798/clusterfuzz-testcase-minimized-ffmpeg_BSF_EVC_FRAME_MERGE_fuzzer-4633529766772736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-28 02:12:12 +02:00
Marton Balint
f983303af4 avcodec: fix misleading indentation warnings after ticks_per_frame deprecation
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-27 21:24:23 +02:00
Richard Acayan
4fa1d3e791 avcodec/v4l2_context: suppress POLLERR and fix crash when buffers are uninitialized
A POLLERR occurs when libavcodec attempts to dequeue output buffers
before enqueuing capture buffers. This could happen to an application
deciding to send the first coded packet. Suppress these POLLERRs when
the buffers are uninitialized and avoid crashing because of enumerating
uninitialized buffers.

See https://trac.ffmpeg.org/ticket/9957 for the original bug report.

Signed-off-by: Richard Acayan <mailingradian@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-27 21:23:39 +02:00
Jan Ekström
91e1d11d14 avcodec/hevcdec: simplify decrementing of MDCV/CLL flags
Mostly done to be able to update the comment so that it no longer
mentions the same flag twice.
2023-07-27 21:45:43 +03:00
Jan Ekström
43e63ff20a avcodec: move content light level SEI handling to h2645_sei
This allows this common H.274 SEI to be parsed from both H.264
as well as HEVC, as well as probably from VVC in the future.

Generally attempts to keep the original code as similar as possible.

FATE test refererence changes only change the order of side data
export within a single frame. Nothing else seems to have changed.
2023-07-27 21:45:43 +03:00
Jan Ekström
33358b862c avcodec: move mastering display colour volume SEI handling to h2645_sei
This allows this common H.274 SEI to be parsed from both H.264
as well as HEVC, as well as probably from VVC in the future.

Generally attempts to keep the original code as similar as possible.

FATE test refererence changes only change the order of side data
export within a single frame. Nothing else seems to have changed.
2023-07-27 21:45:43 +03:00
Michael Niedermayer
0ba719f726
avcodec/cbs_h2645: Avoid an unchecked bytesteram read
The unchecked read caused the 2nd subsequent tell call to move backward resulting
in a negative length

Fixes: assertion failure
Fixes: 60276/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5434126636023808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-25 23:17:29 +02:00
Michael Niedermayer
ac3e6b74bd
avformat/imf_cpl: Replace NULL content_title_utf8 by ""
Suggested-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-25 23:17:29 +02:00
Michael Niedermayer
509ce40f18
avformat/imf_cpl: xmlNodeListGetString() can return NULL
Fixes: NULL pointer dereference
Fixes: 60166/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5998301577871360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-25 23:17:29 +02:00
Michael Niedermayer
c5c719f030
avcodec/h266_metadata_bsf: Check if there are CodedBitstreamFragment units
Fixes: NULL pointer dereference
Fixes: 60269/clusterfuzz-testcase-minimized-ffmpeg_BSF_VVC_METADATA_fuzzer-5215449416335360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-25 23:17:28 +02:00
Michael Niedermayer
574f3aaeff
avcodec/vmixdec: Fix several integer anomalies
Fixes: vmixdec.c:132:34: runtime error: signed integer overflow: -2147483648 * 1856 cannot be represented in type 'int'
Fixes: vmixdec.c:119:20: runtime error: signed integer overflow: -1256 + -2147483648 cannot be represented in type 'int'
Fixes: vmixdec.c:137:36: runtime error: signed integer overflow: 2147483416 * 16 cannot be represented in type 'int'
Fixes: 59843/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-4857434624360448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-25 23:17:28 +02:00
James Almer
673862e947 avcodec/cbs_h266_syntax_template: add missing checks to subpic dimension values
Fixes: division by zero
Fixes: 60306/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5538913553612800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-25 18:06:57 -03:00
James Almer
c92948de40 avcodec/decode: consistently set channel info when parsing param change side data
avctx->ch_layout was being left unchanged.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-25 14:13:42 -03:00
James Almer
d383ae43c2 avcodec/codec_par: always free side data in the destination AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-25 14:13:42 -03:00
Arnie Chang
8d1316e515 lavc/h264chroma: RISC-V V add motion compensation for 4xH and 2xH chroma blocks
Optimize the put and avg filtering for 4xH and 2xH blocks

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2023-07-25 19:10:40 +03:00
Hendrik Leppkes
6dd5f95093 avformat/flvdec: fix size desync when reading timestamp offsets
The size offset was previously being accounted for in flv_set_video_codec
for h264 and mpeg4, instead of being directly accounted for in the spot
where its read, which desynced on HEVC streams.

For clarity, move the size offset directly to the parsing, similar to
how its done for all other header fields.
2023-07-25 13:37:32 +02:00
Timo Rothenpieler
f8035bc426 avformat/flvenc: write proper timestamps when muxing hevc 2023-07-25 02:13:37 +02:00
Paul B Mahol
60244d0bec avfilter/af_afir: fix possible array read-overflow 2023-07-24 11:01:21 +02:00
Paul B Mahol
9fb2efe3b3 avfilter/avf_showcwt: make read only variable const 2023-07-24 11:01:21 +02:00
Andreas Rheinhardt
6e5e74c55b avcodec/evc*: Improve included headers
In particular, don't include avcodec.h in evc_frame_merge_bsf.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-24 10:37:07 +02:00
Andreas Rheinhardt
3fe98db7bb avcodec/vvc_mp4toannexb_bsf: Improve included headers
A BSF should never include avcodec.h at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-24 10:37:07 +02:00
Haihao Xiang
5b11ee9429 lavd/opengl_enc: fix a compiler error
glcontext was added under CONFIG_SDL2

libavdevice/opengl_enc.c: In function ‘opengl_draw’:
libavdevice/opengl_enc.c:1204:15: error: ‘OpenGLContext’ has no member
named ‘glcontext’

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-07-24 10:17:51 +08:00
Wenbin Chen
13f49a7c62 libavfilter/vf_dnn_detect: bbox index may bigger than bbox number
Fix a bug that queried bbox index may bigger than bbox's total number.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-07-24 09:34:11 +08:00
Michael Niedermayer
87f76d3bee
avcodec/aacdec_template: Fix undefined signed interger operations
Fixed: signed integer overflow: -2 * -1085502286 cannot be represented in type 'int'
Fixed: 57986/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5123651145170944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-23 18:08:15 +02:00
Michael Niedermayer
40cec0b465
avcodec/wavarc: Fix k limit
The implementation does not support k=32

Fixes: shift exponent 32 is too large for 32-bit type 'unsigned int'
Fixes: 57976/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5911925807775744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-07-23 18:07:36 +02:00
Andreas Rheinhardt
071c625ad7 fftools/ffmpeg_opt: Reduce scope of variables for deprecated code
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-23 17:55:38 +02:00
Andreas Rheinhardt
8bb1bcf47d fftools/ffmpeg_opt: Fix leak on error
Fixes Coverity id #1539096.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-23 17:55:38 +02:00
Andreas Rheinhardt
0368ded1a9 fftools/opt_common: Fix leak on error
Fixes Coverity issue #743443.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-23 17:55:38 +02:00
Andreas Rheinhardt
2654347d7a fftools/ffmpeg_opt: Fix leak on error
Fixes Coverity issue #1539097.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-23 17:55:38 +02:00
Andreas Rheinhardt
2a44c4bc9e fftools/ffmpeg_mux_init: Fix leak on error
Fixes Coverity issue #1539098.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-23 17:55:38 +02:00