summaryrefslogtreecommitdiff
path: root/libavformat/au.c
Commit message (Collapse)AuthorAge
* avformat/au: Deduplicate codec_tag listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: cleanup on EOF return in au_read_annotation()Michael Niedermayer2020-11-10
| | | | | | | | | | Fixes: memleak Fixes: 26841/clusterfuzz-testcase-minimized-ffmpeg_dem_AU_fuzzer-5174166309044224 Regression since: e680d50eb4feddafb2d8575b21fc5fc8764f4801 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/au: Check for EOF in au_read_annotation()Michael Niedermayer2020-10-23
| | | | | | | | | Fixes: Timeout (too looong -> 1 ms) Fixes: 26366/clusterfuzz-testcase-minimized-ffmpeg_dem_SDX_fuzzer-5655584843759616 Fixes: 26391/clusterfuzz-testcase-minimized-ffmpeg_dem_ALP_fuzzer-5484026133217280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/au: Avoid allocation for metadata stringAndreas Rheinhardt2020-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | When there are potentially annotation (i.e. metadata) fields to write, au_get_annotations() is called to produce a string with them. To do so, it uses an AVBPrint which is finalized to create the string. This is wasteful, because it always leads to an allocation even if the string actually fits into the internal buffer of the AVBPrint. This commit changes this by making au_get_annotations() modify an AVBPrint that resides on the stack of the caller (i.e. of au_write_header()). Furthermore, the AVBPrint is now checked for truncation; limiting the allocations implicit in the AVBPrint allowed to offload the overflow checks. Notice that these were not correct before: The size parameter of avio_write() is an int, yet the string in the AVBPrint was allowed to grow bigger than INT_MAX. And if the length of the string was so near UINT_MAX that the length + 32 overflowed, the old code would write the first eight bytes of the string and nothing more, leading to an invalid file. Finally, the special case in which the metadata dictionary of the AVFormatContext is empty (in which case one still has to write eight binary zeroes) is now no longer treated specially, because this case no longer incurs any allocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: Simplify writing string into AVBPrintAndreas Rheinhardt2020-07-18
| | | | | | by using av_bprintf() instead of several av_bprint_append(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: Remove redundant av_freep()Andreas Rheinhardt2020-07-18
| | | | | | | | | | This av_freep(&key) in conjunction with the fact that the loop condition checks for key != NULL was equivalent to a av_freep(&key) + a break immediately thereafter. But given that there is an av_freep(&key) directly after the loop, the av_freep(&key) is unnecessary and the break can also be added explicitly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: Store strings instead of pointers to strings in arrayAndreas Rheinhardt2020-07-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: check return value of au_read_annotation()Limin Wang2020-07-02
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/au: check return value of av_bprint_finalize()Limin Wang2020-07-02
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: remove unneeded avio_flush() calls from the end of write_trailer ↵Marton Balint2020-01-07
| | | | | | | functions The IO context is always flushed by libavformat/mux.c after write_trailer is called, so this change should have no effect at all.
* avformat: remove avio_flush() calls from the end of write_header functionsMarton Balint2020-01-07
| | | | | | | | | | | | | | To make it consistent with other muxers. The user can still control the generic flushing behaviour after write_header (same way as after packets) using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used. Therefore this change should have no adverse effect on streaming, even if it is assumed that the first packet has a clean buffer, so small seekbacks within the output buffer work even when the IO context is not seekable. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* avformat/au: do not use invalid block_align for small bits per samplePaul B Mahol2018-12-31
| | | | Fixes #5481.
* 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.
* | avformat/au: Read MetaData from AU Sun audio file headerThomas Bernard2016-06-13
| | | | | | | | | | | | recognize title= album= artist= genre= track= Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/au: Write MetaData in AU Sun audio file headerThomas Bernard2016-06-03
| | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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 'f792d3cbb8e8e35c54a9358a55dd596b7a40f228'Michael Niedermayer2014-06-18
|\| | | | | | | | | | | | | | | | | | | * commit 'f792d3cbb8e8e35c54a9358a55dd596b7a40f228': lavf: add the notimestamps flag to the muxers missing it Conflicts: libavformat/adtsenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: add the notimestamps flag to the muxers missing itAnton Khirnov2014-06-18
| |
* | avformat/au: add assert to help source code analyzersMichael Niedermayer2013-10-20
| | | | | | | | | | See: CID1108585 and CID1108603 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: Use G726LE decoder for Sun AU filesCarl Eugen Hoyos2013-10-18
| | | | | | | | | | | | fixes ticket #1955 as suggested by Roman. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-04-11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Move misplaced file author information where it belongs Conflicts: libavcodec/adpcm.c libavcodec/adpcmenc.c libavcodec/gif.c libavcodec/x86/dsputilenc_mmx.c libavcodec/x86/fmtconvert_init.c libavformat/au.c libavformat/gif.c libavformat/mov.c libavformat/nsvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move misplaced file author information where it belongsDiego Biurrun2013-04-11
| |
* | Merge commit '1ecdf8912b9ced51b3267cdcdce5e394d0a3bf8e'Michael Niedermayer2013-03-14
|\| | | | | | | | | | | | | | | | | | | * commit '1ecdf8912b9ced51b3267cdcdce5e394d0a3bf8e': avformat: av_log_ask_for_sample() ---> avpriv_request_sample() Conflicts: libavformat/mxfdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: av_log_ask_for_sample() ---> avpriv_request_sample()Diego Biurrun2013-03-13
| |
* | auenc: strict check for supported codecPaul B Mahol2013-01-30
| | | | | | | | | | | | | | Also check number of streams and give error message why muxing failed. This prevents muxing unsupported codec with known and supported tag. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | auenc: remove put_au_header() and merge its code into au_write_headerPaul B Mahol2013-01-30
| | | | | | | | | | | | Such level of abstraction is pointless. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | au: switch to ff_pcm_read_packet() again, after the mergeMichael Niedermayer2013-01-11
| | | | | | | | | | | | | | This fixes G722 durations Suggested-by: durandal_1707 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f7bf72a4a1146a7583577c9bdc066767e1ba3c6a'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f7bf72a4a1146a7583577c9bdc066767e1ba3c6a': idcinvideo: correctly set AVFrame defaults yadif: Port inline assembly to yasm au: remove unnecessary casts au: return AVERROR codes instead of -1 Conflicts: libavcodec/idcinvideo.c libavfilter/x86/yadif_template.c libavformat/au.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: remove unnecessary castsJustin Ruggles2013-01-09
| |
| * au: return AVERROR codes instead of -1Justin Ruggles2013-01-09
| |
* | Merge commit 'fd9147f11456a7e39a998d7270684922a2a46e6d'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | | | | | * commit 'fd9147f11456a7e39a998d7270684922a2a46e6d': au: cosmetics: pretty-print and remove pointless comments Conflicts: libavformat/au.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: cosmetics: pretty-print and remove pointless commentsJustin Ruggles2013-01-09
| |
* | Merge commit 'c88d245c9866e48cb8a238b7564964c1fcf3315f'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | | | | | | | * commit 'c88d245c9866e48cb8a238b7564964c1fcf3315f': au: use ff_raw_write_packet() au: set stream start time and packet durations Conflicts: libavformat/au.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: use ff_raw_write_packet()Justin Ruggles2013-01-09
| |
| * au: set stream start time and packet durationsJustin Ruggles2013-01-09
| |
* | Merge commit 'af68a2baae6761044cbed95575e8bcfebf55c6f1'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | * commit 'af68a2baae6761044cbed95575e8bcfebf55c6f1': au: use %u when printing id and channels since they are unsigned au: validate sample rate Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: use %u when printing id and channels since they are unsignedJustin Ruggles2013-01-09
| |
| * au: validate sample rateJustin Ruggles2013-01-09
| |
* | Merge commit 'c837b38dd33a11c3810e988a60193a858eb4f58c'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | | | | | | | * commit 'c837b38dd33a11c3810e988a60193a858eb4f58c': au: move skipping of unused data to before parameter validation au: do not arbitrarily limit channel count Conflicts: libavformat/au.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: move skipping of unused data to before parameter validationJustin Ruggles2013-01-09
| | | | | | | | Also do not unnecessarily skip 0 bytes.
| * au: do not arbitrarily limit channel countJustin Ruggles2013-01-09
| | | | | | | | | | Nothing in the AU specification sets a limit on channel count. We only need to avoid an overflow in the packet size calculation.
| * au: do not set pkt->size directlyJustin Ruggles2013-01-09
| | | | | | | | It is already set by av_get_packet() even for partial reads.
| * au: set block_align and use it in au_read_packet()Justin Ruggles2013-01-09
| |
* | Merge commit '9a7b56883d1333cdfcdf0fa7584a333841b86114'Michael Niedermayer2013-01-10
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '9a7b56883d1333cdfcdf0fa7584a333841b86114': au: set bit rate au: validate bits-per-sample separately from codec tag rtpdec_vp8: Mark broken packets with AV_PKT_FLAG_CORRUPT Conflicts: libavformat/au.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * au: set bit rateJustin Ruggles2013-01-09
| |
| * au: validate bits-per-sample separately from codec tagJustin Ruggles2013-01-09
| |
* | au: use ff_raw_write_packet()Justin Ruggles2013-01-04
| |