summaryrefslogtreecommitdiff
path: root/libavformat/aiffdec.c
Commit message (Collapse)AuthorAge
* 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/id3v2: Don't reverse the order of id3v2 APICsAndreas Rheinhardt2021-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing ID3v2 tags, special (non-text) metadata is not applied directly and unconditionally; instead it is stored in a linked list in which elements are prepended. When traversing the list to add APICs (or private tags) at the end, the order is reversed. The same also happens for chapters and therefore the chapter parsing code already reverses the chapters. This commit changes this: By keeping pointers to both head and tail of the linked list one can preserve the order of the entries and remove the reordering code for chapters. Only the pointer to head will be exported: No current caller uses a nonempty list, so exporting both head and tail is unnecessary. This removes the functionality to combine the lists of special metadata read from different ID3v2 tags, but that doesn't make really much sense anyway (and would be trivial to implement if desired) and allows to remove the now unnecessary initializations performed by the callers. The FATE-reference for the id3v2-priv test had to be updated because the order of the tags read into the dict is reversed; for id3v2-priv-remux only the md5 and not the ffprobe output of the remuxed file changes because the order of the private tags has up until now been reversed twice. The references for the aiff/mp3 cover-art tests needed to be updated, because the order of the attached pics is reversed upon reading. It is still not correct, because the muxers write the pics in the order in which they arrive at the muxer instead of the order given by pkt->stream_index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aiffdec: Check that SSND is at least 8 bytesMichael Niedermayer2021-03-03
| | | | | | | | | Fixes: Infinite loop Fixes: 30874/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5933710488764416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiff: Deduplicate codec tags and codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/Makefile: Remove outdated AIFF demuxer dependency on iso_mediaAndreas Rheinhardt2021-02-23
| | | | | | | | | | | | | | | | This is a result of the mov channel parsing stuff being factored out of mov.c twice: Once in 91b782720fd0df5571775b6591bc41797d6ecf78 to isom.c and later in 3bab7cd12802dc5abf2c5cc6dec49e9e249ce204. Also remove the isom.h header; and while just at it, remove an unused mathematics.h inclusion. (isom.c actually depends upon mpeg4audio from libavcodec for avpriv_mpeg4audio_get_config2 and avpriv_mpa_freq_tab; yet there is no configure dependency for iso_media which leads to failure of shared builds.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/aiffdec: Check size before subtraction in get_aiff_header()Michael Niedermayer2021-01-29
| | | | | | | | Fixes: Infinite loop Fixes: 27235/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5761398380167168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: Check packet sizeMichael Niedermayer2020-11-04
| | | | | | | Fixes: Fixes infinite loop Fixes: 26575/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5727522236661760 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/id3v2: Remove unnecessary indirectionAndreas Rheinhardt2020-05-25
| | | | | | | | | ff_id3v2_parse_apic/chapters/priv/priv_dict all had a parameter extra_meta of type ID3v2ExtraMeta ** as if the functions wanted to make *extra_meta point to something else. But they don't, so just use an ID3v2ExtraMeta *. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* 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>
* avformat/aiffdec: fix signed integer overflowPaul B Mahol2019-09-25
| | | | Fixes #8151
* avformat/aiffdec: parse replaygain metadataMoritz Barsnick2019-09-20
| | | | | | Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@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
* avformat/aiffdec: AIFF fix in case of ANNOEduard Sinelnikov2018-01-11
| | | | | | | | | | | Apple's AIFF protocol clearly states that each chucnk which is odd sized a padding should be added. In the old version of aiffdec adding of padding was done in `get_meta`. And in case of unknown chunk name it was done in defalut case. The new version has deleted the padding in default case and added padding adding after the switch. But the new version didn't removed the padding adding in the `get_meta` function so in some cases padding was added twice which leaded to a bug. Fixes: sample.aiff Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aiff: add explicit goto got_soundMisty De Meo2018-01-06
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aiff: add support for XA ADPCMMisty De Meo2018-01-04
| | | | | | | | | Certain AIFF files encode XA ADPCM compressed audio using a chunk with the tag `APCM`. Aside from this custom chunk type, they're otherwise standard AIFF files. I've only observed these files in the Sega Saturn game Sonic Jam so far. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: fix id3 chaptersLukas Stabe2017-10-05
| | | | | | | | | | | These changes store id3 chapter data in ID3v2ExtraMeta and introduce ff_id3v2_parse_chapters to parse them into the format context if needed. Encoders using ff_id3v2_read, which previously parsed chapters into the format context automatically, were adjusted to call ff_id3v2_parse_chapters. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* lavf: fix usages of av_get_codec_tag_string()Clé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.
* | Merge commit '0638b99cdba52554691fc668d9e477bc184c7a33'Matthieu Bouron2017-03-17
|\| | | | | | | | | | | | | | | | | | | * commit '0638b99cdba52554691fc668d9e477bc184c7a33': aiff: Skip padding byte for odd-sized chunks Also removes to odd-size checks from get_aiff_header and get_meta to use the generic path introduced by the original commit. Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
| * aiff: Skip padding byte for odd-sized chunksDiego Biurrun2016-08-10
| | | | | | | | Bug-Id: 660
* | avformat: fix overflows during bit rate calculationAndreas Cadhalpun2016-12-14
| | | | | | | | | | | | | | | | The bit_rate field has type int64_t since commit 7404f3bdb90e6a5dcb59bc0a091e2c5c038e557d. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | aiff: check block_align in aiff_read_packetAndreas Cadhalpun2016-10-21
| | | | | | | | | | | | | | | | It can be unset in avcodec_parameters_from_context and a value of 0 causes SIGFPE crashes. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | aiffdec: fix division by zeroAndreas Cadhalpun2016-10-17
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavf/aiffdec: Default to full rate qcelp as QT does.Carl Eugen Hoyos2016-10-11
| | | | | | | | Fixes decoding of the output file from ticket #4009.
* | lavf/aiffdec: Support QDMC demuxing.Carl Eugen Hoyos2016-07-03
| |
* | 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.
| * aiff: Support demuxing G.722 streamsCarl Eugen Hoyos2015-11-12
| |
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avformat/aiff: add ADP4 DVI ADPCM supportPaul B Mahol2015-10-27
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec: add SDX2 DPCM decoderPaul B Mahol2015-10-26
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/aiffdec: give friendly message if compressed codec tag is unsupportedPaul B Mahol2015-10-25
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/aiffdec: avoid double and ldexp()Michael Niedermayer2015-06-11
| | | | | | | | | | | | | | | | There is no support for non integer sample rates, using doubles/floats currently could only lead to rounding differences between platforms Previous version Reviewed-by: Mark Harris <mark.hsj@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aiffdec: do not fail if header parser hits EOFMichael Niedermayer2015-03-19
| | | | | | | | | | Based on patch by Martin Vignali <martin.vignali@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aiffdec: Stop header parsing once a non header packet is reachedMichael Niedermayer2015-03-19
| | | | | | | | | | | | | | Fix Ticket3530 Based-on debuging work by Martin Vignali <martin.vignali@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | 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
| |
* | avformat/aiffdec: improve readabilityPeter Ross2015-01-09
| | | | | | | | | | Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aiffdec: only read codec tag when there is space in headerPeter Ross2015-01-05
| | | | | | | | | | Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | 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>
* | Do not limit blocksize when reading PCM from aiff.Carl Eugen Hoyos2014-06-03
| | | | | | | | Fixes ticket #3695.
* | ff_id3v2_read: add option to limit ID3 magic number searchPeter Ross2014-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 ' chunk tag. If such chunks are stored sequentially, it is possible for the ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g. [1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...] [2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...] Fixes ticket #3530. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/aiffdec: use ff_get_extradata()Michael Niedermayer2013-12-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix decoding of G.726 in AIFF.Carl Eugen Hoyos2013-10-18
| | | | | | | | Fixes ticket #1973.
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Support decoding G.722 in aiff.Carl Eugen Hoyos2013-06-09
| |
* | Read block_align from extradata when decoding qclp in aiff.Carl Eugen Hoyos2013-04-23
| | | | | | | | Fixes ticket #1287.
* | Skip padding in an id3 tag in aiff files.Carl Eugen Hoyos2013-04-03
| | | | | | | | | | | | Fixes ticket #2430. Reviewed-by: Matthieu Bouron