summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* libavformat: add side_data copy in concat demuxerGerard Sole2021-12-22
| | | | | | | | | | | | Adds support for concat demuxer to copy the side data information from the input file to the resulting file. It will behave like the metadata copy, where the metadata of the first file is kept in the the output file. Extract the current code that already performs the stream side_data copy into a separate method and reuse the method in the concat demuxer. Signed-off-by: Gerard Sole <g.sole.ca@gmail.com>
* avformat/mvdec: explicitly set durationJohn-Paul Stewart2021-12-21
| | | | | | | | Resolves a warning that duration is being innaccurately estimated based on bitrate. Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/mvdec: read frame rate from data streamJohn-Paul Stewart2021-12-21
| | | | | | | | | | Prior to this patch, for version 2 of the file format the frame rate was hard-coded at 15 fps. This uses the 64-bit floating-point value from the data stream, similar to what is already done for version 3 of the file format (around line 206). Signed-off-by: John-Paul Stewart <jpstewart@personalprojects.net> Reviewed-by: Peter Ross <pross@xvid.org>
* avformat/wvenc: Make init function out of write_headerAndreas Rheinhardt2021-12-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/crcenc: Make init function out of write_headerAndreas Rheinhardt2021-12-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sdp: Fix use of uninitialised valueAndreas Rheinhardt2021-12-20
| | | | | | | Fixes Coverity ticket #1495831. Regression since fe31708eaa10af42507b8db773d5af5a56e1aff4. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Avoid allocation for timecode trackAndreas Rheinhardt2021-12-19
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Use smaller types to make struct smallerAndreas Rheinhardt2021-12-19
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/Makefile: Remove superfluous avformat->DNXHD dependenciesAndreas Rheinhardt2021-12-19
| | | | | | | | | There is no mxfenc dependency any more since commit b9a26b9d55f77ebbff3596e46be54bb5fed469d3. Also remove a dnxhddata.h inclusion in mxfenc that was forgotten in the very same commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aviobuf: ffio_copy_url_optionsPierre-Anthony Lemieux2021-12-19
| | | | | Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* lavf/sdp: add more thorough error handlingAnton Khirnov2021-12-17
| | | | | | Return error codes when constructing a stream config fails, rather than just disregarding the failure and continuing. Propagate the error codes from av_sdp_create().
* lavf/sdp: reindent switch() according to our conventionsAnton Khirnov2021-12-17
|
* lavf/sdp: add const qualifiers where appropriateAnton Khirnov2021-12-17
| | | | Declares that these structs are read-only for this code.
* avformat/4xm: Check for duplicate track idsMichael Niedermayer2021-12-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/4xm: Consider max_streams on reallocating tracks arrayMichael Niedermayer2021-12-16
| | | | | | | | Fixes: OOM Fixes: 41595/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-6355979363549184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cinedec: Avoid repeatedly allocating packets beyond the inputMichael Niedermayer2021-12-16
| | | | | | | | Fixes: Timeout Fixes: 41025/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5540848285122560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Check next offset in mov_read_dref()Michael Niedermayer2021-12-16
| | | | | | | | Fixes: signed integer overflow: 9223372036200463215 + 1109914409 cannot be represented in type 'long' Fixes: 41480/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6553086177443840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vivo: Favor setting fps from explicit fractionsMichael Niedermayer2021-12-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vivo: Do not use the general expression evaluator for parsing a ↵Michael Niedermayer2021-12-16
| | | | | | | | | | floating point value Fixes: Timeout Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mvdec: Use 64 bit in timestamp computationMichael Niedermayer2021-12-16
| | | | | | | | | | Fixes: division by zero Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048 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/aviobuf: fix double free by return early on errorSteven Liu2021-12-16
| | | | | | | | | | Because the s->buffer has been freed by av_freep in avio_closep. It should not av_freep the buffer in label fail after avio_closep. Then just move the av_freep before avio_closep and remove the label fail. Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Reviewed-by: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/moflex: Don't use uninitialized timebase for data streamAndreas Rheinhardt2021-12-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/moflex: Free AVPackets via av_packet_free() on errorAndreas Rheinhardt2021-12-16
| | | | | | | (This is not a leak as long as av_free() completely frees blank packets.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Remove redundant prevention against infinite loopAndreas Rheinhardt2021-12-16
| | | | | | | | | | | | | | | | | | | This piece of code has been added as FFmpeg's answer to infinite loops in try_decode_frame() in commit 6072a19b4f311cb172d45e90daad90824e40e4b6. There is no loop around try_decode_frame() any more, so this code can be removed. This code is only triggered in case a) the codec parameter could not be determined, b) the decode delay could not be guessed or c) no packet was ever encountered and the encoder has the AV_CODEC_CAP_CHANNEL_CONF. In these cases the new code will no longer emit a "decoding for stream %d failed" message, which is prima facie false. In case a) an additional "Could not find codec parameters" message is (and will be) emitted. No warning will be emitted any more in case b) (this happens e.g. with some h264-conformance FATE-files). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Remove fake-loopAndreas Rheinhardt2021-12-16
| | | | | | | When flushing, try_decode_frame() itself loops until the desired properties have been found or the decoder is drained. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rtpdec_rfc4175: cosmetic changesLimin Wang2021-12-14
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: deprecate hls_ts_options optionSteven Liu2021-12-13
| | | | | | | Because the hls_ts_options will be misunderstand by user, and then user can use hls_segment_options instead of hls_ts_options. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/hlsenc: add hls_segment_options correct the segment options nameSteven Liu2021-12-13
| | | | | | | Because the hls_ts_options will be misunderstand by user that only can be used in mpegts segments option. So add this option for segments. Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/img2enc: do not ignore IO errorsMarton Balint2021-12-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-12
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: return stored AVIO context error on avio_closeMarton Balint2021-12-12
| | | | | | Otherwise IO errors at avio_flush() before closing may be lost. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/file: use proper return value in file_closeMarton Balint2021-12-12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: Check for duplicate mxf_read_index_entry_array()Michael Niedermayer2021-12-09
| | | | | | | | | Fixes: memleak Fixes: 41596/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6439060204290048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: Check component_depth in mxf_get_color_range()Michael Niedermayer2021-12-09
| | | | | | | | | Fixes: shift exponent 4294967163 is too large for 32-bit type 'int' Fixes: 41449/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6183636217495552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Add const where appropriateAndreas Rheinhardt2021-12-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Fix wrong indentationAndreas Rheinhardt2021-12-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: Simplify data->hex conversionAndreas Rheinhardt2021-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/md5proto: Simplify data->hex conversionAndreas Rheinhardt2021-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Use smaller scope for variablesAndreas Rheinhardt2021-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Simplify data->hex conversionAndreas Rheinhardt2021-12-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Simplify deriving file keyAndreas Rheinhardt2021-12-08
| | | | | | | | Don't use different src and dst in av_tea_crypt(); use in-place modifications instead. Also let av_tea_crypt() encrypt all three blocks in one call. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Don't unnecessarily reinitialize AVTEA contextAndreas Rheinhardt2021-12-08
| | | | | | | | We use ECB, not CBC mode here, so one does not need to reinitialize the context; for the same reason, one can also just let av_tea_crypt() loop over the blocks, avoiding a loop here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Avoid copying data aroundAndreas Rheinhardt2021-12-08
| | | | | | | | | | | | | Up until now, the packets have been read in blocks of at most eight bytes at a time; then these blocks have been decrypted and copied into a buffer on the stack (that was double the size needed...). From there they have been copied to the dst packet. This commit changes this: The data is read in one go; and the decryption avoids temporary buffers, too, by making use of the fact that src and dst of av_tea_crypt() can coincide. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Don't use the same loop counter in inner and outer loopAndreas Rheinhardt2021-12-08
| | | | | | | Due to this bush.aa (from the FATE suite) exported garbage metadata with key "_040930". Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Make ff_data_to_hex() zero-terminate the stringAndreas Rheinhardt2021-12-08
| | | | | | Most callers want it that way anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/rtsp: fix the error code from ffurl_read_complete()Limin Wang2021-12-07
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtsp: add error code handling for ff_rtsp_skip_packet()Limin Wang2021-12-07
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtsp: free the alloc memory if failedLimin Wang2021-12-07
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtsp: remove redundant assignmentLimin Wang2021-12-07
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/concatf: ignore trailing whitespacesGyan Doshi2021-12-07
| | | | | | | | The concatf protocol returns an opaque error on open if concatf list file contains trailing newlines. Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro> Reviewed-by: James Almer <jamrial@gmail.com>