1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

111303 Commits

Author SHA1 Message Date
Kacper Michajłow
0cd2e7dcfb
avformat/http: copy only mime type from Content-Type
Content-Type can include charset and boundary which is not a part of
mime type and shouldn't be copied as such.

Fixes HLS playback when the Content-Type includes additional fields.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2023-06-29 17:28:46 -04:00
Andreas Rheinhardt
f780e07149 avformat/ac4dec: Constify demuxer
The discrepancy between the definition and the declaration
in allformats.c is actually UB.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:22:58 +02:00
Andreas Rheinhardt
652add3a6d avfilter/vf_ccrepack: Constify filter
The discrepancy between the definition and the declaration
in allfilters.c is actually UB.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:22:51 +02:00
Andreas Rheinhardt
22c47b10b2 avcodec/vvc_parser: Constify parser
The discrepancy between the definition and the declaration
in parsers.c is actually UB.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:22:27 +02:00
Andreas Rheinhardt
e132fae1a5 avcodec/cbs_h266: Remove double ;
Fixes a warning from GCC when in pedantic mode:
"extra semicolon in struct or union specified"
May also fix compilation with MSVC, see
https://fate.ffmpeg.org/report.cgi?time=20230629174305&slot=x86_64-msvc17-windows-native

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-06-29 20:21:24 +02:00
James Almer
9367b58e71 tools/target_bsf_fuzzer: set aud option on h266_metadata bsf
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
James Almer
05186be641 avformat/version: bump minor after recent additions
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
45a8a62df9 avformat/rawenc: add H266/VVC muxer
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
ac2b25f4e5 avformat: add demuxer and probe support for H266/VVC
Add demuxer to probe raw vvc and parse vvcc byte stream format.

Co-authored-by: Nuo Mi <nuomi2021@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
James Almer
86796f1f0e avcodec/version: bump minor after recent additions
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Thomas Siedel
54390f4fa7 avcodec: add MP4 to annexb bsf for H266/VVC
Add parser for H.266/VVC MP4 to Annex B byte stream format.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
c7864a9987 avcodec: add Metadata bsf for H266/VVC
Add H.266/VVC metadata bsf.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
b5aefb6e70 avcodec: add bitstream parser for H266/VVC
Add nal parser ff_vvc_parser to parse vvc elementary bitstreams.

Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
dfc62fd1c6 avcodec/cbs: add cbs implementation for H266/VVC
Add CodedBitstreamContext to parse VPS,SPS,PPS in VVC nal units.
Implement parsing and writing of SPS,PPS,VPS,PH,AUD,SEI and slices.
Add ff_cbs_type_h266 to cbs types tables and AV_CODEC_ID_H266
to cbs codec ids.

Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
James Almer
136e96a8a8 avcodec/extract_extradata: add support for H266/VVC
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:50 -03:00
Nuo Mi
0b8c1f26d3 avcodec/h2645_parse: add support for H266/VVC
Co-authored-by: Thomas Siedel <thomas.ff@spin-digital.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-29 14:12:29 -03:00
Romain Beauxis
bcfcc19821 Add FATE test for timed id3 demux.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-06-29 17:33:01 +02:00
Dmitrii Ovchinnikov
f593dc98bf libavcodec/amfenc: add PreAnalysis support
Additional information about the work of preanalysis can be found here:
https://github.com/GPUOpen-LibrariesAndSDKs/AMF/wiki/PreProcessing%20and%20PreAnalysis
2023-06-29 10:49:33 -03:00
Dmitrii Ovchinnikov
9e3f07aa21 amfenc: Update the min version to 1.4.29.0 for AMF SDK. 2023-06-29 10:49:33 -03:00
Michael Niedermayer
9b6d191a66
avcodec/jpeg2000dec: Check for reduction factor and image offset
This combination is not working (it writes out of array)

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-27 22:36:44 +02:00
James Almer
6ff95758e6 avformat/evc: use get_ue_golomb_long()
This partially reverts commit d0fc1b3507, which reintroduced a regression
originally fixed in 5e9986fd2d.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-27 12:52:38 -03:00
Gyan Doshi
285c7f6f6b doc/filters: correct luma terminology
Partially fixes #10427

See https://poynton.ca/notes/colour_and_gamma/ColorFAQ.html#RTFToC11 for
ref.
2023-06-26 16:02:42 +05:30
Tong Wu
d51b0580e4 lavu/hwcontext_qsv: fix memory leak for d3d9 impl
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-06-25 10:01:51 +08:00
Tong Wu
8ea31f694a lavu/hwcontext_qsv: fix memory leak for d3d11va impl
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-06-25 10:01:51 +08:00
Tong Wu
28ed898ac6 avutil/hwcontext_qsv: register free function for device_derive
When qsv device is created by device_derive, the ctx->free function is
not registered, causing potential memory leak because of not properly
closing the MFX session.

Signed-off-by: Tong Wu <tong1.wu@intel.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-06-25 10:01:51 +08:00
Fei Wang
13a10fe892 lavfi/{denoise, procamp, scale, sharpness}_vaapi: Add passthrough mode
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2023-06-25 10:01:51 +08:00
Fei Wang
f2d45bc565 lavfi/vaapi: Add some debug message
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2023-06-25 10:01:51 +08:00
Fei Wang
f565da8346 lavfi/vaapi: Add function to get surface ID from AVFrame
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2023-06-25 10:01:51 +08:00
Lynne
c39e861a3d
vulkan_h264: check if slices_buf exists on end_frame
The issue is that while decode_slice is guaranteed to never get
called without start_frame, end_frame is not. Moreover, it is
not guaranteed it won't be called twice.

On a badly-broken sample, this is what happens, which leads to
a segfault, as vp->slices_buf doesn't exist, as it has been handed
off for decoding already and isn't owned by the frame.

Return an error as it's indicative that it's a corrupt stream rather
than just missing any slices.

Prevents a segfault.
2023-06-25 03:11:38 +02:00
James Almer
10f1bbfe11 avcodec/j2kenc: use uint64_t type for the lambda value
Should fix integer overflows, and improve encoding results.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-24 14:39:04 -03:00
James Almer
35af1695a9 avcodec/aac_ac3_parser: add preprocessor checks for codec specific code
Should fix ticket #10421.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-24 14:38:29 -03:00
Zhao Zhili
af3f120785 avformat/mov: fix overallocation when reading pssh/saiz
mov_try_read_block() allocates 1MB at least, which can be more than
enough. It was called when reading saiz box, which can appear
periodically inside fmp4. This consumes a lot of memory.

We can fix mov_try_read_block() by clamp 'block_size' with 'size'.
However, the function is harmful than helpful. It avoids allocating
large memory when the real data is small. Even in that case, if
allocating large memory directly failed, it's fine to return ENOMEM;
if allocating success and reading doesn't match the given size, it's
fine to free and return AVERROR_INVALIDDATA. In other cases, it's a
waste of CPU and memory.

So I decided to remove the function, and replace it by call
av_malloc() and avio_read() directly.

mov_read_saiz() and mov_read_pssh() need more check, but they don't
belong to this patch.

Fixes #7641 and #9243.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-06-24 12:58:15 +08:00
Michael Niedermayer
3323b515ab
doc/developer: Require new modules to include tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-24 01:50:24 +02:00
James Almer
a9d41ab890 avcodec/evc_frame_merge: remove an av_packet_copy_props() call
And only fill out if no failures can happen, fixing potential leaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 11:06:35 -03:00
Niklas Haas
5fdb12d6a0 lavfi/vf_libplacebo: simplify SAR normalization
The old logic was trying to be excessively clever in "deducing" that the
user wanted to stretch/scale the image when ow/oh differed from iw/ih
aspect ratio. But this is almost surely unintended except in
pathological cases, and in those cases users should simply disable
normalize_sar and do all the stretching/scaling logic themselves. This
is especially important in multi-input mode, where the canvas may be
vastly different from the input dimensions of any stream. Also, passing
through input 0 SAR in multi-input mode is arbitrary and nearly useless,
so again force output SAR to 1:1 here.
2023-06-23 15:18:25 +02:00
James Almer
ffe4ec5c84 avcodec/evc_ps: fix allowed range for pps_pic_parameter_set_id
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 09:39:14 -03:00
James Almer
7347b44224 avcodec/evc_ps: use unsigned types in structs where corresponds
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
5b966be5b8 avcodec/evc_parse: use unsigned types in structs where corresponds
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
528dd5637d avformat/evc: remove duplicate defines
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
3d1199dff6 avformat/evc: add range checks to evcc_parse_sps and return proper error codes
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
552879d621 avformat/evc: remove duplicate check
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
d0fc1b3507 avformat/evc: remove unnecessary struct
And don't use get_ue_golomb_long() for known small values.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
James Almer
b1b45ac9d4 avcodec/evc_frame_merge: ensure the assembled buffer fits in an AVPacket
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-23 08:37:23 -03:00
Michael Niedermayer
4aa1a42a91
avutil/softfloat: Basic documentation for av_sincos_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:46 +02:00
Michael Niedermayer
d84677abd8
avutil/softfloat: fix av_sincos_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:46 +02:00
Michael Niedermayer
fe167bae96
tools/target_dec_fuzzer: Adjust threshold for speex
Fixes: Timeout
Fixes: 59731/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4809436670328832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:46 +02:00
caleb
043a9d09cb
avcodec/jpeg2000htdec: Check for invalid magref length.
Fixes: shift exponent -8 is negative
Fixes: 58328/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-6007789196804096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:45 +02:00
Michael Niedermayer
a4bf559683
avcodec/utils: fix 2 integer overflows in get_audio_frame_duration()
Fixes: signed integer overflow: 256 * 668003712 cannot be represented in type 'int'
Fixes: 59819/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-4674636538052608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-06-23 02:06:45 +02:00
James Almer
25ce1c8333 avformat/id3v2: check the return value of avio_close_dyn_buf()
Fixes ticket #10424.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 21:00:15 -03:00
James Almer
9834660601 avcodec/evc_frame_merge: copy input packet props to output
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-22 16:08:14 -03:00