summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* avformat/mpegenc: Simplify writing padding/stuffingAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Simplify writing qt-compatibility headerAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Simplify reserving space for tfrf tagsAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Limit ism_lookahead to a sane valueAndreas Rheinhardt2021-09-27
| | | | | | | | There can only be a maximum of 255 entries in a tfrf tag, so using more makes no sense; moreover, several size computations can overflow in this case. Fix this by limiting it to 255. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/icoenc: Use avcodec_get_name() instead of codec descriptorAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/icoenc: Simplify writing bitmaskAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafenc: Fix memleak when trailer is never writtenAndreas Rheinhardt2021-09-27
| | | | | | | Do this by using the AVStream's priv_data for the buffer holding the packet size data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafenc: Don't segfault upon allocation errorAndreas Rheinhardt2021-09-27
| | | | | | | | | | | | | | | | | | | If an array for the packet sizes could not be successfully reallocated when writing a packet, the CAF muxer frees said array, but does not reset the number of valid bytes. As a result, when the trailer is written later, avio_write tries to read that many bytes from NULL, which segfaults. Fix this by not freeing the array in case of error; also, postpone writing the packet data after having successfully (re)allocated the array, so that even on allocation error the file can be correctly finalized. Also remove an unnecessary resetting of the number of size entries used at the end. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/cafenc: Fix potential integer overflowAndreas Rheinhardt2021-09-27
| | | | | | | (As long as avio_write() only accepts an int, it makes no sense to try to support sizes that don't fit into an int.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/filmstripenc: Simplify writing reserved elementsAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/chromaprint: Improve returned error codesAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/chromaprint: Add deinit functionAndreas Rheinhardt2021-09-27
| | | | | | Fixes memleaks in case the trailer is never written. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Fix last mfra checkMichael Niedermayer2021-09-26
| | | | | | | | Fixes: signed integer overflow: 9223372036854775360 + 536870912 cannot be represented in type 'long' Fixes: 37940/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6095637855207424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dv: Set AVFMTCTX_NOHEADER flagAndreas Rheinhardt2021-09-26
| | | | | | Audio streams are only added when a packet is read. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/argo_asf: Use memcpy to copy string without its NULAndreas Rheinhardt2021-09-26
| | | | | | | | This avoids a -Wstringop-truncation warning from GCC which takes issue with the fact that the destination might not be NUL-terminated. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jvdec: Make sizeof(JVFrame) smaller to save memoryAndreas Rheinhardt2021-09-26
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jacosubenc: Fix writing extradataAndreas Rheinhardt2021-09-25
| | | | | | | | | | | The terminating '\0' is no longer included in the size of the extradata output by the demuxer since commit 36e61e24e7ac737b38c4382d439329352d9e0c29. E.g. if one remuxes the JACOsub sample JACOsub_capability_tester.jss from the FATE suite, one receives a file not recognized as JACOsub before this patch. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aviobuf: Extend ffio_fill to 64bitsAndreas Rheinhardt2021-09-24
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/omadec: Don't output uninitialized valuesAndreas Rheinhardt2021-09-24
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/riffenc: Fix indentationAndreas Rheinhardt2021-09-24
| | | | | | | Forgotten after bf9a8d183ddcc65b5ae473bb048a3d38bd6df9f3. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenchint: Simplify writing paddingAndreas Rheinhardt2021-09-24
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/astenc: Simplify writing paddingAndreas Rheinhardt2021-09-23
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Set AVSTREAM_PARSE_HEADERS flag for H264Nicolas Gaullier2021-09-23
| | | | | Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/demux: Use r_frame_rate in compute_frame_duration if ↵Nicolas Gaullier2021-09-23
| | | | | | | codec_framerate is unknown Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfdec: rename sub_descriptors as file_descriptorsMarc-Antoine Arnaud2021-09-22
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/concatdec: Use FAIL() macro instead of direct return in ↵Michael Niedermayer2021-09-22
| | | | | | | | | | | concat_parse_script() Fixes: memleak Fixes: 38893/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4785231933079552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dhav: do not use zero fpsMichael Niedermayer2021-09-19
| | | | | | | | | Fixes: assertion failure Fixes: 38332/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-4522405595316224 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/rtsp: Use av_dict_set_int()Andreas Rheinhardt2021-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Use av_opt_set_int() where appropriateAndreas Rheinhardt2021-09-18
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/libsrt: remove url_get_file_handle implementationZhao Zhili2021-09-18
| | | | | | | | SRTSOCKET is an abstraction designed by libsrt, it's not guaranteed to be a real file descriptor. Even if it is, it should not be operated directly outside of libsrt. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: log streamid in listener modeZhao Zhili2021-09-18
| | | | | | | | | It's useful for test client which pass streamid to ffmpeg/ffplay. For example, use ffmpeg to test streamid support in VLC: ./ffmpeg -v info -re -i foo.mp4 -c copy -f mpegts -mode listener srt://127.0.0.1:9000 ./vlc srt://127.0.0.1:9000?streamid=foobar Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: fixes overflow when parsing the PMTNicolas Jorge Dato2021-09-18
| | | | | | | | | | When a possible overflow was detected, there was a break to exit the while loop. However, it should have already substracted 2 bytes from program_info_length (descriptor ID + length). Fixes ticket #9422. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: Use st for AVStream variable in avpriv_set_pts_infoAndreas Rheinhardt2021-09-17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Don't free inexistent ID3v2 metadataAndreas Rheinhardt2021-09-17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move demuxing code out into a new fileAndreas Rheinhardt2021-09-17
| | | | | | | | | | | | | libavformat/utils.c has over 4800 lines and is supposed to contain "various utility functions for use within FFmpeg". In reality it contains all that and the whole demuxing core of libavformat. This is especially bad, because said file includes the FFMPEG_VERSION (the git commit sha) so that it is rebuilt whenever the commit HEAD points to changes. Therefore this commit makes it smaller by moving the demuxing code out to a new file, demux.c (in analogy to mux.c for the muxing code). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move seeking code out into a new fileAndreas Rheinhardt2021-09-17
| | | | | | | | | | | | libavformat/utils.c has over 5500 lines and is supposed to contain "various utility functions for use within FFmpeg". In reality it contains all that and the whole demuxing+seeking core of libavformat. This is especially bad, because said file includes the FFMPEG_VERSION (the git commit sha) so that it is rebuilt whenever the commit HEAD points to changes. Therefore this commit starts making it smaller by factoring the seeking code out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: ReindentationAndreas Rheinhardt2021-09-17
| | | | 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/mux, utils: Use dedicated pointer for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | This gets rid of ugly "->internal" and is in preparation for removing AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Avoid allocation for AVFormatInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | | | | Do this by allocating AVFormatContext together with the data that is currently in AVFormatInternal; or rather: Put AVFormatContext at the beginning of a new structure called FFFormatContext (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVFormatInternal altogether. The biggest simplifications occured in avformat_alloc_context(), where one can now simply call avformat_free_context() in case of errors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux, mxfenc, utils: Use dedicated pointer for AVFormatInternalAndreas Rheinhardt2021-09-17
| | | | | | | This gets rid of ugly "->internal" and is in preparation for removing AVFormatInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc, mux, utils: Use smaller scope for variablesAndreas Rheinhardt2021-09-17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mp3dec: Simplify checking for no-metadataAndreas Rheinhardt2021-09-17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mp3dec: Avoid calling avio_tell() multiple timesAndreas Rheinhardt2021-09-17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mvdec: Don't signal success on parse_audio_var() errorJames Almer2021-09-16
| | | | | | Propagate the error it returned instead. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mvdec: Do not set invalid sample rateMichael Niedermayer2021-09-16
| | | | | | | | | Fixes: signed integer overflow: -682581959642593728 * 16 cannot be represented in type 'long' Fixes: 37883/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5311691517198336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/sbgdec: Check for t0 overflow in expand_tseq()Michael Niedermayer2021-09-16
| | | | | | | | | Fixes: signed integer overflow: 4611686025627387904 + 4611686025627387904 cannot be represented in type 'long' Fixes: 35489/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-4862678601433088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/concatdec: add stream_extradata directiveNicolas George2021-09-16
|
* lavf/concat: add support for chaptersNicolas George2021-09-16
|