summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/aviobuf: increase default read buffer size to 2*max_buffer_size for ↵Marton Balint2020-10-09
| | | | | | | | | | streamed data This should increase the effectiveness of ffio_ensure_seekback by reducing the number of buffer reallocations and memmoves/memcpys because even a small seekback window requires max_buffer_size+window_size buffer space. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: fix indentationMarton Balint2020-10-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: do not allocate a new buffer in ffio_ensure_seekback if ↵Marton Balint2020-10-09
| | | | | | | | not needed Let's move unread data to the start of the old buffer instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: discard part of the IO buffer in ffio_ensure_seekback if ↵Marton Balint2020-10-09
| | | | | | | | | | | | | | | | | | | | | | needed Previously ffio_ensure_seekback never flushed the buffer, so successive ffio_ensure_seekback calls were all respected. This could eventually cause unlimited memory and CPU usage if a demuxer called ffio_ensure_seekback on all it's read data. Most demuxers however only rely on being able to seek back till the position of the last ffio_ensure_seekback call, therefore we change the semantics of ffio_ensure_seekback so that a new call can invalidate seek guarantees of the old. In order to support some level of "nested" ffio_ensure_seekback calls, we document that the function only invalidates the old window (and potentially discards the already read data from the IO buffer), if the newly requested window does not fit into the old one. This way we limit the memory usage for ffio_ensure_seekback calls requesting consecutive data windows. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpjpegdec: make sure we seek back to the ensured bufferMarton Balint2020-10-09
| | | | | | | | It was possible for the old code to seek back before the most recently read data if start of a new multipart was across read boundaries. Now we read some small sections multiple times to avoid this, but that is OK. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: make sure mpegts_resync do not run out of the initially ↵Marton Balint2020-10-09
| | | | | | requested probe buffer Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: fix checks in ffio_ensure_seekbackMarton Balint2020-10-09
| | | | | | | | | | | | | The new buf_size was detemined too conservatively, maybe because of the off-by-one issue which was fixed recently in fill_buffer. We can safely substract 1 more from the new buffer size, because max_buffer_size space must only be guaranteed when we are reading the last byte of the requested window. Comparing the new buf_size against filled did not make a lot of sense, what makes sense is that we want to reallocate the buffer if the new buf_size is bigger than the old, therefore the change in the check. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: check if requested seekback buffer is already readMarton Balint2020-10-09
| | | | | | | | Existing code did not check if the requested seekback buffer is already read entirely. In this case, nothing has to be done to guarantee seekback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: write data into the IO buffer till the very end of the bufferMarton Balint2020-10-09
| | | | | | | There was an off-by-one error when checking if the IO buffer still has enough space till the end. One more byte can be safely written. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/rtsp: allocate correct max number of pollfdsAndriy Gelman2020-10-08
| | | | | | | There is one general rtsp connection plus two connections per stream (rtp/rtcp). Reviewed-by: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtspdec: add newline in log messageAndriy Gelman2020-10-08
| | | | Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/libopenmpt: Don't discard constAndreas Rheinhardt2020-10-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Reset pointer to NULL after freeing itAndreas Rheinhardt2020-10-08
| | | | | | | | | | This is currently safe here, because the effective lifetime of adaptionset_lang is parse_manifest_adaptationset() (i.e. the pointer gets overwritten each time on entry to the function and gets freed before exiting the function), but it is nevertheless safer to reset the pointer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavformat/dashdec: Fix issue with dash on WindowsChristopher Degawa2020-10-08
| | | | | | | | | | | | | | | | | | Use xmlFree instead of av_freep snip from libxml2: * xmlGetProp: ... * Returns the attribute value or NULL if not found. * It's up to the caller to free the memory with xmlFree(). According to libxml2, you are supposed to use xmlFree instead of free on the pointer returned by it, and also using av_freep on Windows will call _aligned_free instead of normal free, causing _aligned_free to raise SIGTRAP and crashing ffmpeg and ffplay. Signed-off-by: Christopher Degawa <ccom@randomderp.com>
* lavf/img2dec: Auto-detect Cintel scanner images.Carl Eugen Hoyos2020-10-08
|
* avcodec: add Cintel RAW decoderPaul B Mahol2020-10-07
|
* lavf/avs2dec.c: optimize code stylehwren2020-10-06
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavf/davs2.c: rename as avs2dec.c for better understandinghwren2020-10-06
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc/avs2_parser.c,lavf/davs2.c: add AVS2_* prefixhwren2020-10-06
| | | | | | Add AVS2_* prefix to macro definitions to avoid confusion Signed-off-by: hwren <hwrenx@126.com>
* lavf/avs3dec: add raw avs3 demuxerhwren2020-10-06
| | | | | Signed-off-by: hbj <hanbj@pku.edu.cn> Signed-off-by: hwren <hwrenx@126.com>
* avformat/movenc: Avoid allocation for timecode trackAndreas Rheinhardt2020-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Don't forget to free fragment buffersAndreas Rheinhardt2020-10-05
| | | | | | | | | | The buffers used when fragmented output is enabled have up until now not been freed in the deinit function; they leak e.g. if one errors out of mov_write_trailer() before one reaches the point where they are normally written out and freed. This can e.g. happen if allocating new vos_data fails at the beginning of mov_write_trailer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Free old vos_data before overwriting itAndreas Rheinhardt2020-10-05
| | | | | | | | Otherwise the old data leaks whenever extradata needs to be rewritten (e.g. when encoding FLAC with our encoder that sends an updated extradata packet at the end). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Don't free AVCodecParameters manuallyAndreas Rheinhardt2020-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Make some AVCodecTag tables staticAndreas Rheinhardt2020-10-04
| | | | | | They are not used anywhere else. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Fix segfault when remuxing rtp hint streamAndreas Rheinhardt2020-10-04
| | | | | | | | | | | | | | | | When remuxing an rtp hint stream (or any stream with the tag "rtp "), the mov muxer treats this as one of the rtp hint tracks it creates internally when ordered to do so; yet this track lacks the AVFormatContext for the hinting rtp muxer, leading to segfaults in mov_write_udta_sdp() if a "trak" atom is written for this stream; if not, the stream's codecpar is freed by mov_free() as if the mov muxer owned it (it does for the internally created "rtp " tracks), but without resetting st->codecpar, leading to double-frees lateron. This commit therefore ignores said tag which makes rtp hint streams unremuxable. This fixes tickets #8181 and #8186. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/moflex: Check m->size before seekingMichael Niedermayer2020-10-04
| | | | | | | | | Fixes: Infinite loop Fixes: 26016/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6195663833137152 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: add tri-ACE demuxerPaul B Mahol2020-10-03
|
* avformat/adxdec: demux multiple blocks at oncePaul B Mahol2020-10-03
| | | | Improves decoding speed by 24x
* avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_ratesJan Ekström2020-10-02
| | | | | | | The generated text streams for chapters lack an AVStream since they are but an internal concept within movenc. Fixes #8910
* avformat/asfdec_f: Change order or operations slightlyMichael Niedermayer2020-10-02
| | | | | | | | Fixes: signed integer overflow: 20 * 5184056935931942919 cannot be represented in type 'long' Fixes: 25466/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4798660247552000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dxa: Use av_rescale() for duration computationMichael Niedermayer2020-10-02
| | | | | | | | Fixes: signed integer overflow: 8224000000 * 1629552639 cannot be represented in type 'long' Fixes: 24908/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4658478506049536 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtsp: fix parse_rtsp_messageZhao Zhili2020-10-02
| | | | | | | 1. Remove the assumption that the message method is TEARDOWN. 2. Don't ignore the error code of ff_rtsp_parse_streaming_commands. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Fix infinite loop in listen mode with UDP transportMartin Storsjö2020-10-02
| | | | | | | | | | | | | | | | | | | | | | In listen mode with UDP transport, once the sender has sent the TEARDOWN and closed the connection, poll will indicate that one can read from the connection (indicating that the socket has reached EOF and should be closed by the receiver as well). In this case, parse_rtsp_message won't try to parse the command (because it's no longer in state STREAMING), but previously just returned zero. Prior to f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5, this caused udp_read_packet to return zero, which is treated as EOF by read_packet. But after that commit, udp_read_packet would continue if parse_rtsp_message didn't return an explicit error code. To keep the original behaviour from before that commit, more explicitly return an error in parse_rtsp_message when in the wrong state. Fixes: #8840 Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/utils: add missing FF_API_LAVF_AVCTX checkJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/sdp: add missing FF_API_LAVF_AVCTX checkJames Almer2020-10-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Fix stack overflow when remuxing timecode tracksAndreas Rheinhardt2020-10-01
| | | | | | | | | | | | | | | | | | | | | | | There are two possible kinds of timecode tracks (with tag "tmcd") in the mov muxer: Tracks created internally by the muxer and timecode tracks sent by the user. If any of the latter exists, the former are deactivated. The former all belong to another track, the source track; the latter don't have a source track set, but the index of the source track is initially zeroed by av_mallocz_array(). This is a problem since 3d894db700cc1e360a7a75ab9ac8bf67ac6670a3: Said commit added a function that calculates the duration of tracks and the duration of timecode tracks is calculated by rescaling the duration (calculated by the very same function) of the source track. This gives an infinite recursion if the first track (the one that will be treated as source track for all timecode tracks) is a timecode track itself, leading to a stack overflow. This commit fixes this by not using the nonexistent source track when calculating the duration of timecode tracks not created internally by the mov muxer. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Fix segfault upon allocation errorAndreas Rheinhardt2020-09-28
| | | | | Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/iff: Check data_size not overflowing int64Michael Niedermayer2020-09-28
| | | | | | | | | Fixes: Infinite loop Fixes: 25844/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5660803318153216 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>
* lavf/hls: add AC-3/EAC-3 to allowed extensions file listJun Zhao2020-09-28
| | | | | | | | | | Add AC-3/EAC-3 to allowed extensions file list. From HTTP Live Streaming 2nd Edition draft-pantos-hls-rfc8216bis-07 section 3.1.3.Packed Audio, HLS demuxer need to support MP3/AC-3/EAC-3. Reviewd-by: Steven Liu <liuqi05@kuaishou.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec: add Argonaut Games Video decoderPaul B Mahol2020-09-27
|
* avformat/argo_brp: use header frame countsZane van Iperen2020-09-27
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_brp: allow v1.1 ASF streams to have a non-22050 sample rate in ↵Zane van Iperen2020-09-27
| | | | | | | | | | | | | | | | certain circumstances It seems that in files where the BASF block isn't first, v1.1 ASF streams are allowed to be non-22050. Either this format is really inconsistent, or FX Fighter and Croc just ignored the sample rate field, requiring the v1.1 restriction in the first place. This bumps the version to 1.2 in these streams so they're not "corrected". Found in Alien Odyssey games files in: ./GRAPHICS/COMMBUNK/{{COMADD1,COMM2_{1,2,3E},COMM3_{2,3,4,5,6}},FADE{1,2}}.BRP Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_brp: cosmeticsZane van Iperen2020-09-27
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_brp: handle the case where the BASF block isn't the firstZane van Iperen2020-09-27
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_brp: support MASK streamsZane van Iperen2020-09-27
| | | | | | We can't actually use them though. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_{asf,brp}: fix potential segfault in ff_argo_asf_fill_stream()Zane van Iperen2020-09-27
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/http: fix memleakZhao Zhili2020-09-25
| | | | | Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: add IPU demuxerPaul B Mahol2020-09-24
|
* avformat/flvdec: RtmpSampleAccess no longer breaks stream detectionPeter van der Spek2020-09-23
| | | | | | | | | | | | | | | | | Since release 4.2, FFmpeg fails to detect the correct streams in an RTMP stream that contains a |RtmpSampleAccess AMF object prior to the onMetaData AMF object. In the debug log it would show "[flv] Unknown type |RtmpSampleAccess". This functionality broke in commit d7638d8dfc3c4ffd0dc18a64937a5a07ed67b354 as unknown metadata packets now result in an opaque data stream, and the |RtmpSampleAccess packet was an "unknown" metadata packet type. With this change the RTMP streams are correctly detected when there is a |RtmpSampleAccess object prior to the onMetaData object. Signed-off-by: Peter van der Spek <p.vanderspek@bluebillywig.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>