summaryrefslogtreecommitdiff
path: root/libavformat/cafdec.c
Commit message (Collapse)AuthorAge
* avformat/cafdec: Implement FLAC-in-CAF parsingMartijn van Beurden2022-07-05
| | | | | | | | The afconvert utility shipped with MacOS supports muxing of FLAC in CAF, see afconvert help output on a recent Mac here: https://hydrogenaud.io/index.php?topic=122509.0 A file created with afconvert free of copyright (licensed CC0) can be found here: http://www.audiograaf.nl/misc_stuff/afconvert-FLAC-in-CAF.caf
* avformat/utils: Move ff_get_extradata to demux_utils.cAndreas Rheinhardt2022-05-10
| | | | | | | | It is only used by demuxers (although it is hypothetically possible that some day e.g. a protocol might need it, but that is unlikely given that they don't deal with AVCodecParameters). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafdec: Do not store empty keys in read_info_chunk()Michael Niedermayer2022-03-27
| | | | | | | | Fixes: Timeout Fixes: 45543/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5684953164152832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* caf: convert to new channel layout APIVittorio Giovara2022-03-15
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/cafdec: Avoid unnecessary avio_tell() callsAndreas Rheinhardt2021-11-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafdec: try skipping various chunks only when seeking is possiblePaul B Mahol2021-09-03
|
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/cafdec: Check channelsMichael Niedermayer2021-04-20
| | | | | | | | Fixes: signed integer overflow: -1184429040541376544 * 32 cannot be represented in type 'long' Fixes: 31788/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6236746338664448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cafdec: Do not build an index if all packets are the sameMichael Niedermayer2021-03-29
| | | | | | | | Fixes: Timeout Fixes: 28214/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6495999421579264 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/caf: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/cafdec: clip sample rateMichael Niedermayer2020-12-24
| | | | | | | | Fixes: 1.21126e+111 is outside the range of representable values of type 'int' Fixes: 27398/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5412960339755008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cafdec: Check the return code from av_add_index_entry()Michael Niedermayer2020-11-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cafdec: Check for EOF in index read loopMichael Niedermayer2020-11-29
| | | | | | | | Fixes: OOM Fixes: 27398/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-541296033975500 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cafdec: Check that bytes_per_packet and frames_per_packet are non ↵Michael Niedermayer2020-11-29
| | | | | | | | | | | | | | negative These fields are not signed in the spec (1.0) so they cannot be negative Changing bytes_per_packet to unsigned would not solve this as it is exported as block_align which is signed Fixes: Infinite loop Fixes: 26492/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5632087614554112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: move AVStream.*index_entries* to AVStreamInternalAnton Khirnov2020-10-28
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Since there are some (semi-)public fields located after these, even though this section is supposed to be private, keep some dummy padding there until the next major bump to preserve ABI compatibility.
* avformat: Don't free old extradata before ff_alloc/get_extradataAndreas Rheinhardt2019-12-12
| | | | | | | | These functions already free it themselves before they allocate the new extradata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Forward errors where possibleAndreas Rheinhardt2019-12-12
| | | | | | | | | | It is not uncommon to find code where the caller thinks to know better what the return value should be than the callee. E.g. something like "if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit changes several instances of this to instead forward the actual error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf/cafdec: Do not fail for unknown atoms with negative size.Carl Eugen Hoyos2019-01-27
| | | | | | | The specification requires the demuxer to only read the data atom up to its given size, this is necessary as atoms are allowed at the end of the file. This patch duplicates the behaviour of the QuickTime player.
* avformat/cafdec: reject multichannel Opus streamsAnton Khirnov2017-09-19
| | | | | | Multichannel Opus streams require channel mapping information in extradata. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/caf: Support demuxing Opus.Carl Eugen Hoyos2017-09-20
| | | | Introduced in macOS High Sierra and iOS 11.
* lavf: use av_fourcc2str() where appropriateClément Bœsch2017-03-29
|
* Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-21
|\ | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
| * lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-30
| | | | | | | | | | | | | | | | It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
* | cafdec: prevent overflow during bit rate calculationAndreas Cadhalpun2016-12-15
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat: add AVFormatContext to ff_get_extradata()Paul B Mahol2016-04-14
| | | | | | | | | | | | Needed for av_log() inside that function. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | cafdec: free extradata before allocating itAndreas Cadhalpun2015-05-13
| | | | | | | | | | | | | | This fixes a memleak if read_kuki_chunk is executed more than once. Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | cafdec: check avio_read return valueAndreas Cadhalpun2015-05-13
| | | | | | | | | | | | | | If avio_read fails, the buffer can contain uninitialized values. Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
* | Merge commit '4d5b99dacdbb56373e5abe2ad35fc87b5c0c5bd2'Michael Niedermayer2014-09-26
|\| | | | | | | | | | | | | * commit '4d5b99dacdbb56373e5abe2ad35fc87b5c0c5bd2': caf: Give context structure a consistent name Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * caf: Give context structure a consistent nameDiego Biurrun2014-09-26
| |
* | Merge commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea'Michael Niedermayer2014-08-19
|\| | | | | | | | | | | | | * commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea': mov: Drop unused parameter from ff_mov_read_esds() Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mov: Drop unused parameter from ff_mov_read_esds()Diego Biurrun2014-08-19
| | | | | | | | This is cleaner and avoids an uninitialized variable warning with MSVC.
| * caf: Use correct printf conversion specifiers for POSIX int typesDiego Biurrun2014-07-28
| |
* | cafdec: check for eof in read_info_chunk()Paul B Mahol2014-08-18
| | | | | | | | | | | | Fixes Ticket #3864 Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: revert %c changes from d92024f18fa3d69937cb2575f3a8bf973df02430Michael Niedermayer2014-03-12
| | | | | | | | | | Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'Michael Niedermayer2014-03-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd92024f18fa3d69937cb2575f3a8bf973df02430': lavf: more correct printf format specifiers Conflicts: libavformat/asfdec.c libavformat/cafdec.c libavformat/dxa.c libavformat/framecrcenc.c libavformat/hnm.c libavformat/iff.c libavformat/mov.c libavformat/mxfdec.c libavformat/rmdec.c libavformat/rpl.c libavformat/smacker.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: more correct printf format specifiersDiego Biurrun2014-03-11
| |
* | avformat/cafdec: use ff_get_extradata()Michael Niedermayer2013-12-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | cafdec: fix overflow checking in read_header()Xi Wang2013-01-20
| | | | | | | | | | | | | | | | | | | | Several compilers such as clang/icc/pathscale will optimize the check pos + size < pos (assuming size > 0) into false, since signed integer overflow is undefined behavior in C. This breaks overflow checking. Use a safe precondition check instead. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | cafdec: Check duration before use.Michael Niedermayer2012-12-12
| | | | | | | | | | | | | | Fix division by 0 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'bfe5454cd238b16e7977085f880205229103eccb'Michael Niedermayer2012-11-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'bfe5454cd238b16e7977085f880205229103eccb': lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h lavf: move "MP3 " fourcc from riff to nut fate: vpx: Add dependencies fate: Fix wavpack-matroskamode test dependencies x86: dsputilenc: port to cpuflags Conflicts: libavformat/internal.h libavformat/nut.c tests/fate/vpx.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>