summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/ape: Check frames sizeMichael Niedermayer2022-09-241-0/+2
| | | | | | | | Fixes: signed integer overflow: 9223372036854775806 + 3 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APE_fuzzer-6389264140599296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ape: fix overflow in total_blocksPaul B Mahol2022-09-161-2/+2
|
* avformat/ape: set packet durationPaul B Mahol2022-09-161-0/+1
|
* avformat/ape: more bits in size for less overflowsMichael Niedermayer2022-06-141-4/+5
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 3 cannot be represented in type 'int' Fixes: 46184/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4678059519770624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ape: convert to new channel layout APIVittorio Giovara2022-03-151-1/+1
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-171-1/+1
| | | | | | | | | | 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/ape: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-071-15/+6
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* lavf: move AVStream.*index_entries* to AVStreamInternalAnton Khirnov2020-10-281-1/+1
| | | | | | | 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/ape: Remove seektable and bittableMichael Niedermayer2020-10-181-50/+25
| | | | | Suggested-by: Andreas Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ape: Error out in case of EOF in the headerMichael Niedermayer2020-07-261-3/+6
| | | | | | | | Fixes: OOM Fixes: 24375/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6216862443241472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ape: Cleanup after ape_read_header() failureMichael Niedermayer2020-06-141-7/+19
| | | | | | | | Fixes: memleaks Fixes: 23306/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5635436931448832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Remove unnecessary av_packet_unref()Andreas Rheinhardt2020-02-101-1/+0
| | | | | | | | | Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Forward errors where possibleAndreas Rheinhardt2019-12-121-9/+13
| | | | | | | | | | 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-211-1/+1
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf/ape: remove unused magic fieldClément Bœsch2017-03-291-2/+0
|
* Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-211-1/+1
|\ | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
| * lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-301-1/+1
| | | | | | | | | | | | | | | | 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 '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-10/+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-231-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ape: Show more information for loglevel verbose.Carl Eugen Hoyos2016-01-191-1/+1
| | | | | | | | Requested by Andy E, fixes bug 687.
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-271-1/+1
| |
* | avformat/ape: Use av_malloc_array()Michael Niedermayer2015-04-071-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-141-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-141-2/+2
| |
* | 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>
* | Use correct msvc type specifiers for ptrdiff_t and size_t.Carl Eugen Hoyos2014-04-241-1/+1
| | | | | | | | | | | | | | The Windows runtime aborts if it finds %t or %z. Fixes ticket #3472. Reviewed-by: Ronald Bultje
* | avformat/ape: free packet on avio_read() failureMichael Niedermayer2013-12-251-1/+3
| | | | | | | | | | | | | | Fixes memleak Fixes: msan_uninit-mem_7fcc198b365b_8417_sh3.ape Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/ape: zero seektable&bittable and warn when they where only ↵Michael Niedermayer2013-12-251-2/+4
| | | | | | | | | | | | | | | | | | partially filled Fixes use of uninitialized memory Fixes: msan_uninit-mem_7fcc198b365b_8417_sh3.ape Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/ape: check version in probeMichael Niedermayer2013-11-101-3/+7
| | | | | | | | | | | | Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: use ff_alloc_extradata()Paul B Mahol2013-10-131-2/+2
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '183b9d843a9533774fabd3984a52f3987001acbc'Michael Niedermayer2013-09-121-4/+1
|\ \ | |/ | | | | | | | | | | | | * commit '183b9d843a9533774fabd3984a52f3987001acbc': ape: Don't allow the seektable to be omitted See: e7cb161515fc9fb6d30d1681d64d9ba7ad737a4e Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: Don't allow the seektable to be omittedMartin Storsjö2013-09-121-1/+1
| | | | | | | | | | | | | | | | | | The seektable is required for filling in ape->frames[i].pos further down. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '488b2984fece7ad0c2596826fee18e74aa904667'Michael Niedermayer2013-09-031-2/+2
|\ \ | |/ | | | | | | | | | | * commit '488b2984fece7ad0c2596826fee18e74aa904667': ape demuxer: check for EOF in potentially long loops Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape demuxer: check for EOF in potentially long loopsAnton Khirnov2013-09-021-2/+2
| | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
| * ape: use correct context for the bit table printed in debugKostya Shishkov2013-03-271-1/+1
| |
* | ape: check avio_read() return valuewm42013-08-111-0/+2
| | | | | | | | | | | | This sets pkt->size to absurd values on failure otherwise. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix a typo in the Monkey's Audio demuxer.Carl Eugen Hoyos2013-03-271-1/+1
| |
* | Merge commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f'Michael Niedermayer2013-03-261-3/+25
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '613a37eca4c7b8eefceaa3e0231c23ad090ca94f': ape: 3.80-3.92 decoding support h264: Remove an unused variable Conflicts: libavcodec/apedec.c libavformat/ape.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: 3.80-3.92 decoding supportKostya Shishkov2013-03-251-3/+25
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-03-151-1/+1
|\ \ | |/ | | | | | | | | | | * qatar/master: add support for Monkey's Audio versions from 3.93 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * add support for Monkey's Audio versions from 3.93Kostya Shishkov2013-03-151-1/+1
| |
* | lavf/apedec: return meaningful error codesPaul B Mahol2012-12-061-5/+5
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavf/ape: Fix stream duration calculationjamal2012-08-231-5/+3
| | | | | | | | | | | | | | Fixes ticket #1662 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-1/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-06-241-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: log: Only include unistd.h if configure found it ape: create audio stream before reading tags. mov: make a length variable larger. image2: Add "start_number" private option to the demuxer image2: Add "start_number" private option to the muxer avconv: remove a forgotten debugging printf. avconv: use more descriptive names for hardcoded filters. avconv: remove redundant handling of async. doc/filters: fix typo. h264: use asm cabac reader under a generic condition Conflicts: ffmpeg.c libavformat/img2dec.c libavformat/img2enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ape: create audio stream before reading tags.Anton Khirnov2012-06-241-6/+6
| | | | | | | | | | | | | | Tags may contain attached picture, which will be exported as video streams. This ensures that the audio stream is always the first.
* | ape: Fix null ptr dereference with files missing a seekatable.Michael Niedermayer2012-05-291-0/+3
| | | | | | | | | | | | | | Such files are currently not supported as the table is used at several points Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-061-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: cosmetics: Align muxer/demuxer declarations mpeg12: Do not change frame_pred_frame_dct flag and demote error into a warning avcodec: remove avcodec_guess_channel_layout() avutil: Add av_get_default_channel_layout() Conflicts: doc/APIchanges libavcodec/mpeg12.c libavformat/cdg.c libavformat/matroskaenc.c libavformat/mpegts.c libavformat/nuv.c libavformat/wav.c libavutil/audioconvert.c libavutil/audioconvert.h libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>