summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/chromaprint: Fix writing raw fingerprintAndriy Gelman2019-10-16
| | | | | | | | | The pointer fp after the call to chromaprint_get_raw_fingerpoint() points to an array of uint32_t whereas the current code assumed just a char stream. Thus when writing the raw fingerprint, the output would be truncated by a factor of 4. For reference the declaration of the function from chromaprint.h is: int chromaprint_get_raw_fingerprint(ChromaprintContext *ctx, uint32_t **fingerprint, int *size);
* avformat/latmenc: abort if no extradata is availableJames Almer2019-10-15
| | | | | | | Fixes ticket #8273. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/chromaprint: improve logging messageAndriy Gelman2019-10-14
| | | | Setting silence_threshold requires that -algorithm is set to 3.
* avformat/chromaprint: Fix fp_format optionAndriy Gelman2019-10-14
| | | | | The fp_format option was incorrectly declared, so it could not be set via string constants.
* avformat/Makefile: Fix aiffdec replaygain dependencyAndreas Rheinhardt2019-10-14
| | | | | | | Forgotten in 6390f52a. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: parse sdtp atom and set the pkt disposable flag accordinglyMatthieu Bouron2019-10-12
| | | | | | Allows the creation of the sdtp atom while remuxing MP4 to MP4. This atom is required by Apple devices (iPhone, Apple TV) in order to accept 2160p medias.
* avformat/mpjpegdec: ensure seekback for latest chunkMoritz Barsnick2019-10-12
| | | | | | | | | | | Not only the first, but each latest chunk must be cached to allow seekback after finding the mime boundary. Fixes trac #5023 and #5921. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: fix strict boundary search stringMoritz Barsnick2019-10-12
| | | | | | | | | | | | | | | | | | According to RFC1341, the multipart boundary indicated by the Content-Type header must be prepended by CRLF + "--", and followed by CRLF. In the case of strict MIME header boundary handling, the "--" was forgotten to add. Fixes trac #7921. A side effect is that this coincidentally breaks enforcement of strict MIME headers against servers running motion < 3.4.1, where the boundary announcement in the HTTP headers incorrectly used the prefix "--", which exactly matched this bug's behavior. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpjpegdec: fix finding multipart boundary parameterMoritz Barsnick2019-10-12
| | | | | | | | | | The string matching function's return value was evaluated incorrectly. Fixes trac #7920. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dv: free all allocated structs on dv_read_header failureJames Almer2019-10-11
| | | | | | | | | Also propagate proper AVERROR codes while at it. Fixes ticket #8230. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/iff: fix memleak when get st->codecpar->extradata failed in ↵Steven Liu2019-10-10
| | | | | | | iff_read_header Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/jvdec: fix memleak when read_header failedSteven Liu2019-10-10
| | | | | Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/ivfdec: Change the length field to 32 bitsRaphaël Zumer2019-10-08
| | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
* avformat/ivfenc: Change the length fields to 32 bitsRaphaël Zumer2019-10-08
| | | | | | | | | | There is no change in the encoded bitstream, but this ensures that the written field length is consistent with the reference implementation. Unused bytes are zeroed out for backwards compatibility. Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
* avformat/ivfenc: Comment the length field encoding processRaphaël Zumer2019-10-08
| | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
* avformat/mpsubdec: Clear queue on errorMichael Niedermayer2019-10-08
| | | | | | | | Fixes: Memleaks Fixes: 17219/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5720539124989952 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpeg: Remove set-but-unused variableAndreas Rheinhardt2019-10-08
| | | | | | Forgotten in 7da57875. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hls: fix missing segment offset reset on last segment when ↵vectronic2019-10-08
| | | | | | | http_multiple is enabled. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/hls: pass http offset options to http requestvectronic2019-10-08
| | | | | | | | made with persistent connections to prevent incorrect reset of offset when demuxing HLS+FMP4 Signed-off-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/http: add ff_http_do_new_request2 for optionsvectronic2019-10-08
| | | | | | | | add ff_http_do_new_request2() which supports options to be applied to HTTPContext after initialisation with the new uri Signed-off-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/hlsenc: replace with av_freep for all av_freeLimin Wang2019-10-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: replace with av_dirname to get the directoryLimin Wang2019-10-08
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: remove the unnecessary null pointer checkLimin Wang2019-10-08
| | | | | 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-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mmst: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/network: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/avidec: add logging context to logSteven Liu2019-10-08
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/rtmpptoto: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/udp: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: add logging context to logSteven Liu2019-10-08
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flac_picture: Avoid allocation of AVIOContextAndreas Rheinhardt2019-10-07
| | | | | | | 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-06
| | | | | | | | | 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-06
| | | | | | | | 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-06
| | | | | | DefaultDuration Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't rescale mastering display valuesJames Almer2019-10-05
| | | | | | Simplifies code. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpeg: better fix for MLP versus PCM-DVD misdetectionPaul B Mahol2019-10-05
|
* avformat/matroskadec: Fix demuxing ProResAndreas Rheinhardt2019-10-04
| | | | | | | | | | | | | | | | | | 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-03
| | | | | | | | | | | 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-03
| | | | | | 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-03
| | | | | | | | | | 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-01
| | | | | | | | | | | 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-01
| | | | Helps to fix ticket #8197.
* lavf/utils: support duration estimate method dumpJun Zhao2019-09-30
| | | | | | | | 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-30
| | | | | | 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-30
| | | | | | 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-30
| | | | | | | | 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-30
| | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | 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-28
| | | | | | | | | | | | 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-28
| | | | | | | | | | | | | | | | | | | | | | | | 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>