aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/matroskadec: Check pre_ns for overflowMichael Niedermayer2024-12-241-2/+3
| | | | | | | | Fixes: signed integer overflow: -3483479120376300096 - 7442323944145700864 cannot be represented in type 'long' Fixes: 383187489/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4561470580391936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: free stream_info when the surrounding array is freedMichael Niedermayer2024-12-241-0/+3
| | | | | | | | Fixes: memleak Fixes: 378408474/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5699368121860096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iff: remove surplus if statementPeter Ross2024-12-221-2/+0
| | | | Fixes CID 1636854
* avformat/riff: map 0069 twocc to ADPCM IMA XBOX decoderPeter Ross2024-12-221-1/+1
|
* avformat/Makefile: include object files for image_vbn_pipe demuxerPeter Ross2024-12-211-0/+1
|
* avformat/iff: SndAnim decodingPeter Ross2024-12-201-101/+210
| | | | Fixes ticket #5553.
* avformat/isom: use more of the existing channel layout bitmap definesJames Almer2024-12-191-3/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: fix setting num_samples_per_frame for OPUSJames Almer2024-12-191-4/+12
| | | | | | | | As per section 3.11.1 of the IAMF spec, the sample rate used in Codec Config for Opus shall be 48kHz, regardless of the original sample rate used during encoding. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/Makefile: add iso_writer golomb_tab from shared library dependencyPeter Ross2024-12-191-0/+1
|
* avformat/hevc: add support for writing alpha layerTimo Rothenpieler2024-12-162-16/+136
|
* avformat/iamf_parse: fix setting duration for the last subblock in a ↵James Almer2024-12-152-2/+4
| | | | | | | | | parameter definition When subblock durations are constant, the last block may be smaller and the value needs to be calculated. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: add checks to parameter definition durationsJames Almer2024-12-152-4/+25
| | | | | | | Section 3.6.1 of the IAMF spec states "When constant_subblock_duration is equal to 0, the summation of all subblock_duration in this parameter block SHALL be equal to duration.". Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't reallocate extradata when converting dvdsub paletteMarth642024-12-131-3/+2
| | | | | | | | | | | | After introduction of ff_dvdclut_palette_extradata_cat() to convert DVD subtitle palettes from YUV to RGB, a leak is introduced because of the call to ff_alloc_extradata(). This is not necessary, instead we should free the extradata because ff_bprint_to_codecpar_extradata() will finalize the bprint'ed string to the codecpar and set the length. Fixes leak introduced in 3b0e6c0eccd7d61eb089370fc5f2196c2b30336f. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/iamfdec: don't set individual streams as dependentJames Almer2024-12-131-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_writer: add support for expanded channel layoutsJames Almer2024-12-131-4/+17
| | | | | | Defined in Immersive Audio Model and Formats 1.1.0, sections 3.6.2 and 3.7.3 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iamf_parse: add support for expanded channel layoutsJames Almer2024-12-133-3/+70
| | | | | | Defined in Immersive Audio Model and Formats 1.1.0, sections 3.6.2 and 3.7.3 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/smush: read ANIMv2 a/v parametersManuel Lauss2024-12-091-3/+14
| | | | | | | | | | | | | | SMUSH ANIM files with subversion 2 provide additional fields for framerate and samplerate, use them if available, otherwise default to 12 fps which is the default for almost all ANIMv2 since 1995. Fixes the too-fast playback of test files from LucasArts games released 1995-1997. It was not noticed since Audio for those isn't decoded by ffmpeg. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: use dvdclut for YUV to RGB conversion of DVD subtitle palettesMarth642024-12-082-51/+21
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/hevc: also print NALU idsJames Almer2024-12-081-0/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: add a log context to ff_isom_write_{hvcc,lhvc}James Almer2024-12-086-47/+50
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegts: correctly skip TP_extra_header in m2tsllyyr2024-12-081-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | instead of just resyncing and skipping a bunch of TS packets, leading to a loss of frames. Before this, a stray byte with the value of 0x47 in TP_extra_header would throw off the detection of where TS packets start. A typical file that could cause issues would look like this: 00000300: 238f 4780 4750 1110 0000 01e0 0000 84c0 ^^ ^^ The first four bytes here are TP_extra_header and the actual TS packet starts at offset 0x304 FFmpeg would try to read a packet at 0x300 but since nothing skips the 4 byte TP_extra_header, find that the first byte is not 0x47 and immediately go into mpegts_resync, and incorrectly detect the stray 0x47 in the TP_extra_header at 0x302 as the new sync byte. Fix this by correctly skipping the first 4 bytes if the source packet is 192 bytes. Signed-off-by: llyyr <llyyr.public@gmail.com> Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avformat/mm: fix packets pts generation and add seek supportPaul B Mahol2024-12-081-17/+14
| | | | Signed-off-by: Peter Ross <pross@xvid.org>
* avformat/movenc: log stream index for invalid pkt durationGyan Doshi2024-12-071-3/+3
|
* avformat/mov: add support for pssh boxMalek Assaad2024-12-053-5/+50
| | | | | | | * Enable PSSH box writing to mov & moof. * Enable senc, saio & saiz writing to moof when writing fragments. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegts: is_pes_stream() use switch caseScott Theisen2024-12-031-2/+12
| | | | | | | also add STREAM_TYPE_PRIVATE_SECTION since a private_section() is not a PES_packet(). Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts*: reduce use of magic numbersScott Theisen2024-12-033-117/+170
| | | | | | | | | | | | Note ISO/IEC 13818-1 defines an Extension_descriptor with descriptor_tag value 0x3f (63), so I kept the DVB comment. I don't know what defines stream_type value 0x8a as DTS. I don't have any Blu-ray standards so I don't know where those stream_type values are defined. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/qcp: Check for read failure in headerMichael Niedermayer2024-12-021-1/+2
| | | | | | | | Fixes: Use of uninitialized value Fixes: 71551/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-4647386712965120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dxa: check bpcMichael Niedermayer2024-12-021-0/+2
| | | | | | | | Fixes: integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 373971762/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-4880491112103936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/iamf_parse: reject ambisonics mode > 1Michael Niedermayer2024-12-021-1/+1
| | | | | | | | | | ambisonics mode > 1 does not initialize any layer but layer 0 is unconditionally dereferenced Fixes: poc-2024-11 Fixes: null pointer dereference Found-by: 苏童 <220235212@seu.edu.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dvdvideodec: check return code of ff_dvdclut_yuv_to_rgb()Marth642024-12-011-1/+4
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/dvdvideodec: fix missing last chapter marker due to off-by-oneMarth642024-12-011-1/+1
| | | | | | | When using fast chapter marker calculation (default), the last marker is inadverdently ignored due to an off-by-one. Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/libssh: fix credential variables typoMarth642024-11-261-3/+3
| | | | Signed-off-by: Marth64 <marth64@proxyid.net>
* avformat/framecrc: add AVFMT_NODIMENSIONS flagMarton Balint2024-11-251-1/+1
| | | | | | Framecrc does not need frame dimensions to work correctly. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: add missing stts array syncing in mov_build_indexJames Almer2024-11-251-3/+40
| | | | | | | | | Also fix checks for sc->stts_count that assume it may not be in sync with sample count. Missed in 865c73c86f9d9d167be7e41ad6cef71eba92dadd. Fixes parsing durations in some cases. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mm: add fallthrough commentPeter Ross2024-11-251-0/+1
| | | | Fixes CID 1634888
* avformat/icodec: fix integer overflow with nb_palMichael Niedermayer2024-11-251-1/+1
| | | | | | | | | | Fixes: runtime error: signed integer overflow Fixes: 42536949/clusterfuzz-testcase-minimized-fuzzer_loadfile-6199846684393472 Found-by: ossfuzz Reported-by: Kacper Michajlow Tested-by: Kacper Michajlow Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: don't unconditionally set all audio packets in fragments as ↵James Almer2024-11-241-4/+1
| | | | | | | | key frames Some audio codecs, like TrueHD, have non key frames. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: set all frames in a keyframe simple box as keyframesJames Almer2024-11-241-1/+1
| | | | | | | And not just the first, as it was being done for lacing. The spec states that the flag applies to everything inside the simple box. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/test/movenc: set audio packets as key framesJames Almer2024-11-241-0/+1
| | | | | | | Don't depend on the generic code setting this. This is in preparation for a following change. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: write stss boxes for xHE-AACJames Almer2024-11-241-0/+1
| | | | | | This is in preparation for a following change. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/spdifdec: parse headers for audio codecsJames Almer2024-11-241-0/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: don't disable edit lists when writing CMAF outputJames Almer2024-11-221-8/+0
| | | | | | | | | They are needed for audio tracks with priming samples, where negative CTS offsets can't be used. Fixes ticket #11031. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Populate packet duration using stts atom instead of guessingDarren Mo2024-11-222-17/+167
| | | | | | Fixes tickets #7855 and #11312. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: rename MOVCtts.duration to offsetJames Almer2024-11-223-19/+20
| | | | | | The value is a timestamp offset, not a duration. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegts: add DVB descriptor_tag values already in useScott Theisen2024-11-221-0/+11
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: don't write a calculated avgBitrate when the provided one ↵James Almer2024-11-221-0/+3
| | | | | | | | | | | is unset avgBitrate == 0 is used to signal a VBR track, so if that value is propagated by an encoder, don't overwrite it with a calculated value based on track size. Part of a fix for ticket #11303. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: fix writing hvcC when no arrays are provided in ↵James Almer2024-11-221-3/+5
| | | | | | | | | | | hvcC-formatted input Don't reject extradata with missing PS NALUs if array_completeness is not requested. Fixes a regression since a696b28886. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: don't write PS NALUs in hvcC for codec tag hvc1James Almer2024-11-221-2/+3
| | | | | | array_completeness shall be 1 for those tracks. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mm: decode raw chunk type and skip unknown audio chunk typePeter Ross2024-11-211-2/+7
|
* avcodec/mm: set audio pts proportionally to audio offsetPeter Ross2024-11-211-1/+2
|