summaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* avformat/hlsenc: replace with av_dirname to get the directoryLimin Wang2019-10-081-16/+6
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: remove the unnecessary null pointer checkLimin Wang2019-10-081-24/+2
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mms: add logging context to logSteven Liu2019-10-081-8/+8
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mmst: add logging context to logSteven Liu2019-10-081-20/+20
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/network: add logging context to logSteven Liu2019-10-081-2/+2
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/avidec: add logging context to logSteven Liu2019-10-081-7/+7
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/rtmpptoto: add logging context to logSteven Liu2019-10-081-1/+1
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/udp: add logging context to logSteven Liu2019-10-081-4/+4
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add logging context to logSteven Liu2019-10-081-4/+4
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flac_picture: Avoid allocation of AVIOContextAndreas Rheinhardt2019-10-071-7/+3
| | | | | | | Put an AVIOContext whose lifetime doesn't extend beyond the function where it is allocated on the stack instead of allocating and freeing it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/subtitles: Check nb_subs in ff_subtitles_queue_finalize()Michael Niedermayer2019-10-061-0/+3
| | | | | | | | | Fixes: null pointer dereference Fixes: 17828/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5645915116797952 Fixes: Ticket8147 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: Avoid allocation of AVIOContextAndreas Rheinhardt2019-10-061-7/+3
| | | | | | | | Put an AVIOContext whose lifetime doesn't extend beyond the function where it is allocated on the stack instead of allocating and freeing it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskaenc: use r_frame_rate as fallback to set a track's ↵James Almer2019-10-061-0/+3
| | | | | | DefaultDuration Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't rescale mastering display valuesJames Almer2019-10-051-23/+10
| | | | | | Simplifies code. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpeg: better fix for MLP versus PCM-DVD misdetectionPaul B Mahol2019-10-051-1/+8
|
* avformat/matroskadec: Fix demuxing ProResAndreas Rheinhardt2019-10-041-4/+5
| | | | | | | | | | | | | | | | | | The structure of a ProRes frame in mov/mp4 is that of a typical atom: First a 32 bit BE size field, then a tag detailling the content. Said size field includes the eight bytes of the atom header. This header is actually redundant, as the size of the atom is already known from the containing atom. It is therefore stripped away when muxed into Matroska and so the Matroska demuxer has to recreate upon demuxing. But it did not account for the fact that the size field includes the size of the header and this can lead to problems when a decoder uses the in-band size field. Fixes ticket #8210. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/aiffenc: Remove wrong and redundant checkAndreas Rheinhardt2019-10-031-3/+0
| | | | | | | | | | | The check "if (!pb->seekable & AVIO_SEEKABLE_NORMAL)" is wrong, because ! has higher precendence than &. But it is also redundant, because this part of the code is only ever reached when the AVIO_SEEKABLE_NORMAL flag is set for pb. So simply remove the check. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffenc: Fix potential memleak upon failureAndreas Rheinhardt2019-10-031-3/+4
| | | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffenc: Use standard packet list functionsAndreas Rheinhardt2019-10-031-29/+4
| | | | | | | | | | Up until now, aiffenc didn't rely on the standard functions for adding an element to a linked list and freeing the list, but instead reimplemented them. This has been changed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/electronicarts: If no packet has been read at the end do not treat ↵Michael Niedermayer2019-10-011-2/+6
| | | | | | | | | | | it as if theres a packet Fixes: Assertion failure Fixes: 17770/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5700606668308480 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/avio: Print https warning also for avio_find_protocol_name().Carl Eugen Hoyos2019-10-011-4/+3
| | | | Helps to fix ticket #8197.
* lavf/utils: support duration estimate method dumpJun Zhao2019-09-301-1/+14
| | | | | | | | add new function duration_estimate_name to dump duration estimate method, it's will help to debug some duration issue. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/utils: Cosmetics: fix indentation for estimate_timingsJun Zhao2019-09-301-3/+3
| | | | | | fix indentation for estimate_timings when dump start_time/duartion. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/utils: correct the duration estimation method for nut demuxerJun Zhao2019-09-301-1/+5
| | | | | | in fact, nut demuxer use the PTS for duration estimation. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/nutdec: add logging context to logJun Zhao2019-09-301-3/+3
| | | | | | | | Add logging context to log, it's will help debuging. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/utils: change the log level to warning if can't get durationJun Zhao2019-09-301-2/+2
| | | | | | | | change the log level to warning if can't get duration, it's will help to debug some duration issue Signed-off-by: vacingfang <vacingfang@tencent.com> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/utils: Remove unnecessary initializationsAndreas Rheinhardt2019-09-281-7/+5
| | | | | | | | | | | | | | | | | | | | Up until now, read_frame_internal always initialized the packet it received. But since the recent changes to ff_read_packet, this is no longer needed: If the parsing queue is initially empty upon entering read_frame_internal, the packet will now either contain content upon success or be blank upon failure of ff_read_packet. If the parsing queue is initially not empty, the packet will be overwritten with the oldest one from the parsing queue. Similarly, it is unnecessary to initialize ret in read_frame_internal. In parse_packet, it is easily possible to only initialize the packet used as temporary storage for the output if said packet is used at all; furthermore, this packet doesn't need to be zero-initialized, because av_init_packet will initialize every field except size and data and those fields will be set by av_parser_parse2. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Improve parsing packetsAndreas Rheinhardt2019-09-281-15/+13
| | | | | | | | | | | | Up until now, parse_packet() used a stack packet in case the stream is flushed. But using such a packet is unnecessary as there is an AVPacket readily available, it just needs to be used. Whether flushing is intended or not will now be signalled by an explicit parameter rather than by whether the packet parameter is NULL. This removes a few checks in parse_packet(), gets rid of the initialization of the stack packet and also reduces usage of sizeof(AVPacket) in libavformat. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Avoid copying packets unnecessarilyAndreas Rheinhardt2019-09-281-23/+18
| | | | | | | | | | | | | | | | | | | | | | | | Up until now, read_frame_internal in avformat/utils.c uses a spare packet on the stack that serves no real purpose: At no point in this function is there a need for another packet besides the packet destined for output: 1. If the packet doesn't need a parser, but is output as is, the content of the spare packet (that at this point contains a freshly read packet) is simply copied into the output packet (via simple assignment, not av_packet_move_ref, thereby confusing ownership). 2. If the packet needs parsing, the spare packet will be reset after parsing and any packets resulting from the packet read will be put into a packet list; the output packet is not used here at all. 3. If the stream should be discarded, the spare packet will be unreferenced; the output packet is not used here at all either. Therefore the spare packet and the copies can be removed in principle. In practice, one more thing needs to be taken care of: If ff_read_packet failed, the output packet was not affected, now it is. But given that ff_read_packet returns a blank (as if reset via av_packet_unref) packet on failure, there is no problem from this side either. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Don't create unnecessary referencesAndreas Rheinhardt2019-09-281-3/+4
| | | | | | | | | When AVFMT_FLAG_GENPTS is set, av_read_frame would put a reference to a packet in the packet list (via av_packet_ref) and then immediately thereafter unreference the original packet. This has been changed to move the reference instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Fix memleaks IIAndreas Rheinhardt2019-09-281-3/+7
| | | | | | | | | | | Up until now, avformat_find_stream_info had a potential for memleaks: When everything was fine, it read packets and (depending upon whether AVFMT_FLAG_NOBUFFER was set) put them in a packet list or unreferenced them when they were no longer needed. But upon failure, said packets would leak if they were not already on the packet list. This patch fixes this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Don't initialize in loopsAndreas Rheinhardt2019-09-281-4/+6
| | | | | | | | | | | | | | | | Since the recent changes to ff_packet_list_put, the source packet will be automatically reset when the reference is moved to the packet list, so that it is unnecessary to reinitialize the packet in the loops in parse_packet and ff_read_packet; initializing once at the beginning is enough. This also fixes a potential, but currently unexisting problem: If the raw packet buffer was initially not empty and probe_codec() failed, then the packet returned would not be initialized. But given that probe_codec() currently can't fail (always returns 0) this was not an acute danger. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavformat/rtsp: return error if rtsp_hd_out is null instead of crashRoss Nicholson2019-09-271-0/+3
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat: use avpriv_mpeg4audio_get_config2()James Almer2019-09-274-6/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/dhav: fix demuxer since recent breakagePaul B Mahol2019-09-271-2/+11
|
* avformat/g729dec: set packet duration and correctly set timebase infoPaul B Mahol2019-09-271-2/+2
| | | | Fixes #6704.
* avformat/nut: add pcm_s64 supportPaul B Mahol2019-09-271-0/+2
|
* aformat/movenc: add missing padding to output track extradataJames Almer2019-09-261-5/+10
| | | | | | | Fixes ticket #8183. Tested-by: Thierry Foucu <tfoucu@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Fix undefined shiftAndreas Rheinhardt2019-09-261-1/+2
| | | | | | Fixes the movenc FATE-test. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: ensure that all packets in AVPacketList are reference countedAndreas Rheinhardt2019-09-252-1/+7
| | | | | | | This is done so that its data is really owned by the packet. This was already true for the current callers. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Move the reference to the packet listAndreas Rheinhardt2019-09-251-15/+17
| | | | | | | | | | | | | | | | | Up until now, ff_packet_list_put had a flaw: When it moved a packet to the list (meaning, when it ought to move the reference to the packet list instead of creating a new one via av_packet_ref), it did not reset the original packet, confusing the ownership of the data in the packet. This has been done because some callers of this function were not compatible with resetting the packet. This commit changes these callers and fixes this flaw. In order to indicate that the ownership of the packet has moved to the packet list, pointers to constant AVPackets are used whenever the target of the pointer might already be owned by the packet list. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: unref packet on AVInputFormat.read_packet() failureJames Almer2019-09-251-0/+2
| | | | | | | | Demuxers may have allocated a packet before encountering an error and aborting. Fixes ticket #8150 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Fix memleaksAndreas Rheinhardt2019-09-251-4/+12
| | | | | | | | | | | | | | ff_read_packet had potential memleaks: 1. If av_packet_make_refcounted fails, it means that the packet is not refcounted, but it could nevertheless carry side data and therefore needs to be unreferenced. 2. If putting a packet on a packet list fails, it wasn't unreferenced. Furthermore, read_frame_internal leaked a packet's (side) data if a context update was required and failed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: Assert that stream_index is validAndreas Rheinhardt2019-09-251-4/+2
| | | | | | | | | | | There is currently an ordinary check for this (which would lead to a memleak), but given that no demuxer should ever return a packet with an invalid stream_index it is more appropriate for this to be an assert. FATE passes with this change. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/mov: Fix timestamp rescale on sidx atomJun Li2019-09-261-1/+1
| | | | | | Fix #5090 Fix the timestamp rescale issue, from sidx timebase to stream's timebase.
* avformat/sdsdec: fix undefined behaviourPaul B Mahol2019-09-251-3/+3
| | | | Fixes #8163, #8164, #8165.
* avformat/aiffdec: fix signed integer overflowPaul B Mahol2019-09-251-1/+4
| | | | Fixes #8151
* lavf/4xm: fix memory leak in error handing pathJun Zhao2019-09-251-1/+2
| | | | | | | need to free the header in error path. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/utils: Do not assume duration is non negative in compute_pkt_fields()Michael Niedermayer2019-09-241-4/+4
| | | | | | | | | | Several subtitle demuxers set negative durations Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long' Fixes: 16925/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5766519790764032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Test size and packet numbers a bit moreMichael Niedermayer2019-09-241-8/+19
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
OpenPOWER on IntegriCloud