aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/mov: allowing custom udta atoms to pass through their values ↵Ken McGaugh2025-07-051-1/+1
| | | | | | correctly when export_all option specified. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm: Sanyo LD-ADPCM decoderPeter Ross2025-07-041-0/+1
|
* avformat/rtpdec_asf: fix leak in ff_wms_parse_sdp_a_line()Lidong Yan2025-07-031-1/+3
| | | | | | | | | In ff_wms_parse_sdp_a_line(), it allocates memory in buf, but doesn't free buf when avformat_alloc_context() failed. Add av_free(buf) before return to prevent from leak. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtpdec_latm: fix leak in parse_fmtp_config()Lidong Yan2025-07-031-1/+1
| | | | | | | | av_mallocz() allocates memory in config, but we forget to free it if init_get_bits() failed. Replace return ret with goto end. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/whip: fix format string for printing size_tTimo Rothenpieler2025-07-031-3/+3
|
* avformat/tls: clean up new whip optionsTimo Rothenpieler2025-07-032-5/+5
|
* avformat/tls: remove unused fingerprint optionTimo Rothenpieler2025-07-033-8/+2
|
* avformat/tls_openssl: use existing context handleTimo Rothenpieler2025-07-031-6/+6
|
* avformat/tls: fix udp initTimo Rothenpieler2025-07-031-3/+9
|
* avformat/udp: don't override 0 localportTimo Rothenpieler2025-07-031-1/+1
|
* avformat/tls: don't use http_proxy for udp socketsTimo Rothenpieler2025-07-031-1/+1
|
* avformat/tls: use non protocol specific error messageTimo Rothenpieler2025-07-031-1/+1
|
* avformat/whip: remove redundant WHIP: prefix from all loggingTimo Rothenpieler2025-07-031-75/+75
|
* avformat/whip: don't leak options dictTimo Rothenpieler2025-07-031-0/+1
|
* avformat/whip: use av_dict_set_int for intTimo Rothenpieler2025-07-031-6/+3
|
* avformat/Makefile: don't hardcode openssl for whip muxerTimo Rothenpieler2025-07-031-1/+1
|
* avformat/dump: add support for 3D Reference Displays Information side dataJames Almer2025-07-011-0/+13
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/apvdec: add framerate optionDawid Kozinski2025-06-272-3/+26
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/demux: Fix segfault due to avcodec_open2 failurePavel Koshevoy2025-06-271-1/+7
| | | | | | | Fixes 'ffprobe 1_poc.mp4' segfault introduced with commit 0021484d05f9b0f032fa319399de6e24eea0c04f codec_close should not assume that the codec_id did not change.
* avformat/whip: check the exchange sdp url is start with httpSteven Liu2025-06-261-0/+8
| | | | | | | | Make sure the WHIP protocol performs the SDP offer/answer exchange with the WebRTC peer over HTTP. Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Reviewed-by: Jack Lau <jacklau1222@qq.com>
* avformat/whip: Remove unnecessary pkt checksSteven Liu2025-06-261-2/+0
| | | | | | | | | | h264_annexb_insert_sps_pps (called after write_packet) reorganizes PPS, SPS, and IDR packets in H.264 streams. Since write_packet already validates pkt, redundant null checks in h264_annexb_insert_sps_pps can be removed. Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Reviewed-by: Marvin Scholz <epirat07@gmail.com>
* avformat/iamf_parser: remove unreachable codeJames Almer2025-06-261-2/+0
| | | | | | | | expanded_loudspeaker_layout is only present and read on the first layer. Fixes Coverity issue #1655173. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tee: fix multiple bsfs in teeMarvin Scholz2025-06-261-1/+1
| | | | | | | | | | | | | Since 155508c6e925f4f2f5e77087a7e1925b3de735ff specifying multiple bsfs for different streams was broken: "[bsfs/a=h264_metadata:bsfs/v=h264_metadata]out.mp4|..." This incorrectly only parsed the first bsfs specification. The reason for this is that the dictionary is modified in the iterator, hence invalidating the iterator. The simplest fix for this is to simply iterate from the beginning in each loop given that the previous entry is removed.
* avformat/mov: Check that sample_count is allocated in mov_parse_heif_items()Michael Niedermayer2025-06-261-1/+1
| | | | | | | | | Fixes: NULL pointer dereference Fixes: 416811958/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5425269114732544 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>
* avformat/iamfdec: remove unused variables after recent changesJames Almer2025-06-241-4/+1
| | | | | | Fixes -Wunused-but-set-variable warnings Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: fix layout checks when demixing_info is not presentJames Almer2025-06-241-1/+1
| | | | | | Fixes -Wtautological-overlap-compare warnings Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: use named constants in more placesJames Almer2025-06-241-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: reindent after previous commitJames Almer2025-06-241-8/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: add extra constrains for Parameter Sets in Audio ElementsJames Almer2025-06-241-7/+33
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: factor out getting loudspeaker_layout valuesJames Almer2025-06-241-26/+39
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf: fix setting channel layout for Scalable layersJames Almer2025-06-243-31/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way streams are coded in an IAMF struct follows a scalable model where the channel layouts for each layer may not match the channel order our API can represent in a Native order layout. For example, an audio element may have six coded streams in the form of two stereo streams, followed by two mono streams, and then by another two stereo streams, for a total of 10 channels, and define for them four scalable layers with loudspeaker_layout values "Stereo", "5.1ch", "5.1.2ch", and "5.1.4ch". The first layer references the first stream, and each following layer will reference all previous streams plus extra ones. In this case, the "5.1ch" layer will reference four streams (the first two stereo and the two mono) to encompass six channels, which does not match out native layout 5.1(side) given that FC and LFE come after FL+FR but before SL+SR, and here, they are at the end. For this reason, we need to build Custom order layouts that properly represent what we're exporting. ---- Before: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 5.1(side) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 5.1.2 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 5.1.4 Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) ---- AFter: Stream group #0:0[0x12c]: IAMF Audio Element: Layer 0: stereo Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Layer 1: 6 channels (FL+FR+SL+SR+FC+LFE) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Layer 2: 8 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Layer 3: 10 channels (FL+FR+SL+SR+FC+LFE+TFL+TFR+TBL+TBR) Stream #0:0[0x0]: Audio: opus, 48000 Hz, stereo, fltp (default) Stream #0:1[0x1]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:2[0x2]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:3[0x3]: Audio: opus, 48000 Hz, mono, fltp (dependent) Stream #0:4[0x4]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Stream #0:5[0x5]: Audio: opus, 48000 Hz, stereo, fltp (dependent) Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: try to retype the channel layout for ambisonics_mode == 0James Almer2025-06-241-5/+7
| | | | | | | In most cases, the channel ids will match the standard Ambisonic Order, saving us the need to use a custom order layout. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: ensure each layer's channel layout contains all ↵James Almer2025-06-241-2/+22
| | | | | | channels from the previous one Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: prevent overreads in update_extradataJames Almer2025-06-241-5/+12
| | | | | | | | | Fixes: libavcodec/put_bits.h:232:32: runtime error: shift exponent -19 is negative Fixes: Assertion n>=0 && n<=32 failed at ./libavcodec/get_bits.h:406 Fixes: 398527871/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6602025714647040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iff: Check nb_channels == 0 in CHNLMichael Niedermayer2025-06-231-1/+1
| | | | | | | | | | Fixes: division by 0 Fixes: 418396712/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6104388018176000 Fixes: 418478219/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-4569544410857472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtp: G.728 muxing and demuxingPeter Ross2025-06-232-1/+2
|
* avformat/aiff: G.728 muxing and demuxingPeter Ross2025-06-232-0/+4
|
* avformat/riff: G.728 muxing and demuxingPeter Ross2025-06-232-0/+3
|
* avformat/g728dec: raw G.728 demuxerPeter Ross2025-06-233-0/+60
|
* avformat/mov: add more sanity checks when reading clap boxesJames Almer2025-06-221-0/+5
| | | | | | | | | If the apperture window is bigger than the canvas, then the clap box is invalid and there's no point calculating cropping values. Fixes: libavformat/mov.c:1295:14: runtime error: -256 is outside the range of representable values of type 'unsigned long' Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/whip: replace AV_OPT_FLAG_DECODING_PARAM to ENCODINGJack Lau2025-06-211-6/+6
| | | | | Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/whip: mark as experimentalJack Lau2025-06-211-1/+1
| | | | | | | | This patch doesn't effect WHIP usage via command, as WHIP always needs to be explicitly specified Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/tls_openssl: fix warnings when openssl is lower versionJack Lau2025-06-211-0/+8
| | | | | | | | | | | | | | | | | api doc: https://docs.openssl.org/1.0.2/man3/BIO_s_mem In higher versions (openssl 1.0.2 and higher), the function signature is BIO *BIO_new_mem_buf(const void *buf, int len), so passing a const string doesn't cause an warnings. However, in lower versions of OpenSSL, the function signature becomes BIO *BIO_new_mem_buf(void *buf, int len), which leads to warnings. OpenSSL guarantees that it will not modify the string, so it's safe to cast the pem_str to (void *) to avoid this warning. Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: set array entry count after the array is allocated in ↵James Almer2025-06-201-3/+3
| | | | | | | | heif_add_stream() Ensures no bogus values being preserved after returning. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/sbgdec: fix leak in sbg_read_header()Lidong Yan2025-06-171-2/+4
| | | | | | | | | | In sbg_read_header(), if avformat_new_stream() failed, it returns without cleanup, which may cause memory leaks. Replace return statement with goto so that we would first clean up then return. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/dhav: Check reading dataAndreas Rheinhardt2025-06-171-10/+10
| | | | | | Prevents potential use of uninitialized data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dhav: Fix check for seekabilityAndreas Rheinhardt2025-06-171-3/+3
| | | | | | | AVIOContext.seekable is a bitfield. Also check for seekability earlier. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Fix editlist with hybrid_fragmentedZhao Zhili2025-06-161-2/+7
| | | | | | | | | The segment_duration must not be set to zero when writing the moov atom for the second time. This is related to edit lists in standard MP4 files. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/rtmpproto: fix rmtp packet leak in gen_connect()Lidong Yan2025-06-161-0/+2
| | | | | | | | | | | In libavformat/rtmpproto.c:gen_connect(), if check on string length or check on codec fourcc failed, ff_rtmp_packet_create() allocated data in pkt would leak. Add ff_rtmp_packet_destory before return error code. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Reviewed-by: Zhao Zhili <quinkblack@foxmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hls: fix typo in Range header comment (chore)Jack Lau2025-06-151-1/+1
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>