summaryrefslogtreecommitdiff
path: root/libavformat/riffdec.c
Commit message (Collapse)AuthorAgeFilesLines
* libavformat/riffec: Zero-initialize channels in ff_get_wav_headerWill Cassella2022-09-201-1/+1
| | | | | | | | | | Clang's static analyzer complains that leaving the variable uninitialized could lead to a code path where the uninitialized value is written to at the end of this function. This patch simply zero-initializes that variable to avoid that. Signed-off-by: Will Cassella <cassew@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/riffdec: don't unconditionally overwrite WAVEFORMATEXTENSIBLE layoutJames Almer2022-09-111-3/+8
| | | | | | | | Do it only if the value conflicts with the previous channels value. Fixes ticket #9912 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Move ff_get_extradata to demux_utils.cAndreas Rheinhardt2022-05-101-0/+1
| | | | | | | | 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>
* riff: convert to new channel layout APIVittorio Giovara2022-03-151-7/+14
| | | | | | 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: Use ffio_read_size where appropriateAndreas Rheinhardt2021-08-061-3/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove/replace some unnecessary avcodec.h inclusionsAndreas Rheinhardt2021-07-221-3/+2
| | | | | | | Also remove other unnecessary headers and include headers directly while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: fix pcm zork decoderPaul B Mahol2020-02-161-1/+1
| | | | Fixes #1939
* avformat: Don't free old extradata before ff_alloc/get_extradataAndreas Rheinhardt2019-12-121-2/+0
| | | | | | | | 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/riffdec: pass correct pointer to av_logPaul B Mahol2019-04-071-3/+3
|
* Merge commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89'James Almer2017-09-281-3/+4
|\ | | | | | | | | | | | | | | | | * commit '0539d84d985e811e5989ef27c13f7e2dda0f9b89': asfdec: Account for different Format Data sizes See 76853a3e0ce4d4ef09ffcca7307991b8db832cd4 Merged-by: James Almer <jamrial@gmail.com>
| * asfdec: Account for different Format Data sizesAlexandra Hájková2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | | | Some muxers may use the BMP_HEADER Format Data size instead of the ASF-specific one. Bug-Id: 1020 CC: libav-stable@libav.org Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | lavf/riff: Support decoding files with broken mediasubtype base guid.Thierry Foucu2017-02-171-0/+2
| | | | | | | | Fixes ticket #6100.
* | Merge commit '7f549b8338ed3775fec4bf10421ff5744e5866dd'Clément Bœsch2017-02-021-2/+3
|\ \ | |/ | | | | | | | | | | | | | | * commit '7f549b8338ed3775fec4bf10421ff5744e5866dd': riff: don't overwrite bps from WAVEFORMATEX if EXTENSIBLE doesn't contain that data. Only cosmetics, the change was already present. Merged-by: Clément Bœsch <cboesch@gopro.com>
| * riff: don't overwrite bps from WAVEFORMATEX if EXTENSIBLE doesn't contain ↵Hendrik Leppkes2016-07-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | that data. According to the specification on the MSDN [1], 0 is valid for that particular field, and it should be ignored in that case. [1]: http://msdn.microsoft.com/en-us/library/windows/desktop/dd757714(v=vs.85).aspx Bug-Id: 950 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avformat: add AVFormatContext to ff_get_extradata()Paul B Mahol2016-04-141-2/+2
| | | | | | | | | | | | Needed for av_log() inside that function. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-47/+47
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-231-40/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-271-1/+1
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavf/riffdec: Remove \n from avpriv_report_missing_feature().Carl Eugen Hoyos2016-03-061-1/+1
| | | | | | | | Found-by: Clément Bœsch
* | riffdec: Explicitly null-terminate array to work around VC++ bugBruce Dawson2016-02-011-0/+3
| | | | | | | | | | | | | | | | | | Due to this bug in VC++ 2015 Update 1: https://connect.microsoft.com/VisualStudio/feedback/details/2291638 the 'key' array in ff_read_riff_info() ends up being not null terminated which led to failures in a Chromium unit tests. Update 2 should have a fix, but until then it is important to avoid problems.
* | avformat/riffdec: remove special case for bitrate > 32bitMichael Niedermayer2015-12-031-15/+1
| | | | | | | | | | | | AVCodecContext.bitrate is 64bit Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/riffdec: Initialize bitrateMichael Niedermayer2015-12-031-1/+1
| | | | | | | | | | | | Fixes CID1338334 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | XMA1 and XMA2 stereo decodersPaul B Mahol2015-11-061-5/+22
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavf/riff: Support decoding Ambisonic wav files.Carl Eugen Hoyos2015-09-161-0/+2
| | | | | | | | Reported and tested by Andy Furniss, adf d lists at gmail
* | avformat/riffde: Fix integer overflow in bitrateMichael Niedermayer2015-07-121-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'f1bdc234370401c032cd85184e93c7c155eb6d62'Michael Niedermayer2015-07-121-10/+20
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'f1bdc234370401c032cd85184e93c7c155eb6d62': riff: Validate bitrate Conflicts: libavformat/riffdec.c See: 189420cb561929e05f5cc4224cdca83740a24a32 Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * riff: Validate bitrateAndreas Cadhalpun2015-07-111-1/+19
| |
* | riffdec: prevent negative bit rateAndreas Cadhalpun2015-07-121-0/+8
| | | | | | | | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'd80811c94e068085aab797f9ba35790529126f85'Michael Niedermayer2015-07-121-2/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd80811c94e068085aab797f9ba35790529126f85': riff: Use the correct logging context Conflicts: libavformat/asfdec_o.c libavformat/avidec.c libavformat/dxa.c libavformat/matroskadec.c libavformat/mov.c libavformat/riff.h libavformat/riffdec.c libavformat/wavdec.c libavformat/wtvdec.c libavformat/xwma.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * riff: Use the correct logging contextLuca Barbato2015-07-111-2/+3
| |
* | Merge commit '1b4c468477f3b8d372da8ef4e5405539ad9c1501'Michael Niedermayer2015-06-301-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '1b4c468477f3b8d372da8ef4e5405539ad9c1501': riff: Validate the wav header size before trying to parse it Conflicts: libavformat/riffdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * riff: Validate the wav header size before trying to parse itLuca Barbato2015-06-281-0/+3
| |
* | avformat/riffdec: Forward error code from avio_read() in ff_get_guid()Michael Niedermayer2015-06-281-2/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/riffdec: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2014-12-221-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | wavdec: RIFX file format supportThomas Volkert2014-12-181-8/+26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/riffdec: ask for samples with wav header size < 14Michael Niedermayer2014-11-301-0/+3
| | | | | | | | | | | | Based on commit by Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | replace calls to url_feof() with avio_feof()James Almer2014-08-081-1/+1
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/riff: return error code from ff_get_guid()Michael Niedermayer2014-02-121-2/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Move GUID-related objects to riffenc.c and riff.c.Carl Eugen Hoyos2014-01-291-8/+0
| | | | | | | | This simplifies the following eac3-in-wav patch.
* | avformat/riffdec: use ff_get_extradata()Michael Niedermayer2013-12-251-2/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-131-4/+1
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'd07aa3f02b73ab1371c13ac7898338380ca0932b'Michael Niedermayer2013-09-291-0/+5
|\ \ | |/ | | | | | | | | | | * commit 'd07aa3f02b73ab1371c13ac7898338380ca0932b': riffdec: Add sanity checks for the sample rate Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * riffdec: Add sanity checks for the sample rateMartin Storsjö2013-09-291-0/+5
| | | | | | | | | | | | | | | | This avoids a division by zero for G726. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '255d9c570e117f0fcb8e51fa2c5996f3c4b2052b'Michael Niedermayer2013-08-061-16/+34
|/ | | | | | | | | | | * commit '255d9c570e117f0fcb8e51fa2c5996f3c4b2052b': riff: Move demuxing code to a separate file. Conflicts: configure libavformat/riff.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* riff: Move demuxing code to a separate file.Diego Biurrun2013-08-061-0/+229