summaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* avformat/mpeg: move the header_str free into end labelSteven Liu2019-10-221-2/+2
| | | | | | fix CID: 1454875 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/segafilmenc: remove unneeded codeSteven Liu2019-10-221-2/+0
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/matroskaenc: CosmeticsAndreas Rheinhardt2019-10-211-18/+18
| | | | | | | | | | Contains renaming of variables (e.g. mkv_write_cues() contained variables called tracknum that actually contain the index of a track in s->streams and not the track number (which can differ in case an explicit dash track number is set)). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Use more appropriate function nameAndreas Rheinhardt2019-10-211-10/+8
| | | | | | | | | | | | | | mkv_start_new_cluster() actually didn't start a new cluster, but ended the old one instead and emitted a debug message that it had started a new cluster. This has been changed: The debug message has been moved to the place that really starts a new cluster and the function has been renamed to mkv_end_cluster(). Furthermore, without this debug message the function can be used for flushing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Remove redundant assertAndreas Rheinhardt2019-10-211-1/+1
| | | | | | | | | | | | | | The Matroska muxer groups index entries with the same pts together in order to save a few bytes. Because of Matroska's variable-length length fields, mkv_write_cues() does this by first finding out how many index entries will be grouped together before actually writing them. Currently, it is asserted at both of these stages that the stream index of the list of designated index entries is valid. But the second assert is redundant, because the very same index entries have already been checked. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Move track-related fields to mkv_trackAndreas Rheinhardt2019-10-211-26/+15
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Use ffio_free_dyn_bufAndreas Rheinhardt2019-10-211-17/+6
| | | | | | | instead of replicating its behaviour. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: Fix memleak upon failureAndreas Rheinhardt2019-10-211-18/+16
| | | | | | | | | | | | | | | | | The Matroska muxer up until now leaked memory in two scenarios: 1. If an error happened during writing the trailer, as mkv_write_trailer() returned early without cleaning up. 2. If mkv_write_header() indicated success despite an error in the underlying AVIOContext. In this case avformat_write_header() returned the IO error and according to the API the caller is not allowed to call av_write_trailer(), so that no cleanup happened for the allocations made in mkv_write_header(). This has been fixed by using a dedicated deinit function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/oggenc: free buffered page lists while uninitializing the muxerJames Almer2019-10-211-0/+9
| | | | | | | If the trailer is never writen, there could be buffered pages that would leak. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/flacenc: add a deinit functionJames Almer2019-10-211-2/+9
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mp3enc: add init and deinit functionsJames Almer2019-10-211-4/+20
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/ttaenc: add a deinit functionJames Almer2019-10-211-0/+10
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avienc: add deinit functionJames Almer2019-10-211-5/+15
| | | | | | | Fixes ticket #8302 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: call AVOutputFormat->deinit() when freeing the contextJames Almer2019-10-212-7/+13
| | | | | | | | | | | | Despite the doxy stating that it's called when the muxer is destroyed, this was not true in practice. It's only called by av_write_trailer() and on init() failure. An AVFormatContext may be closed without writing the trailer if errors ocurred while muxing packets, so in order to prevent memory leaks, it should effectively be called when freeing the muxer. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/pjsdec: Check duration for overflowMichael Niedermayer2019-10-201-0/+2
| | | | | | | | Fixes: signed integer overflow: -3 - 9223372036854775807 cannot be represented in type 'long' Fixes: 17828/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5645915116797952 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/options: don't call avformat_free_context() within ↵James Almer2019-10-191-4/+6
| | | | | | | | | avformat_alloc_context() avformat_free_context() expects AVFormatContext->internal to not be NULL. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/nutenc: free all missing dynamic AVIOContext on header writing failureJames Almer2019-10-191-4/+7
| | | | | | Fixes part of ticket #8316 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/sapdec: check av_strdup() return value and fix memleakSteven Liu2019-10-191-0/+4
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mvdec: check av_strdup() return valueSteven Liu2019-10-191-0/+2
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mtv: check av_strdup() return valueSteven Liu2019-10-191-0/+2
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mpeg: check av_strdup() return valueSteven Liu2019-10-191-0/+5
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/libsrt: check av_strdup() return value and fix memleakSteven Liu2019-10-191-1/+15
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: check av_strdup() return valueSteven Liu2019-10-191-0/+6
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/cinedec: check av_strdup() return valueSteven Liu2019-10-191-0/+4
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/mpegenc: check for stream private data during deinitJames Almer2019-10-181-0/+2
| | | | | | Prevents pointer dereferences when streams were not fully initialized. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/nutenc: don't allocate a dynamic AVIOContext if no index is going ↵James Almer2019-10-181-1/+4
| | | | | | | | to be written Fixes ticket #8295 Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/hlsenc: fix memory leakJun Zhao2019-10-181-0/+2
| | | | | | | fix memory leak Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/mpegenc: Fix memleaks and return valuesAndreas Rheinhardt2019-10-171-12/+19
| | | | | | | | | | | | | | | | | | If there is an error in mpeg_mux_init() (the write_header function of the various MPEG-PS muxers), two things might happen: 1. Several fifos might leak. Instead of freeing them, the goto fail part of the functions freed the private data of the AVStreams instead, although this will be freed later in free_stream() anyway. 2. And if the function is exited via goto fail, it automatically returned AVERROR(ENOMEM), although this is also used when the error is not a memory allocation failure. Both of these issues happened in ticket #8284 and have been fixed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/shortendec: Check k in probeMichael Niedermayer2019-10-161-1/+7
| | | | | | | | Fixes: Assertion failure Fixes: 17640/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5708767475269632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/chromaprint: Fix writing raw fingerprintAndriy Gelman2019-10-161-1/+1
| | | | | | | | | 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-151-1/+2
| | | | | | | 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-141-1/+1
| | | | Setting silence_threshold requires that -algorithm is set to 3.
* avformat/chromaprint: Fix fp_format optionAndriy Gelman2019-10-141-1/+1
| | | | | The fp_format option was incorrectly declared, so it could not be set via string constants.
* avformat/Makefile: Fix aiffdec replaygain dependencyAndreas Rheinhardt2019-10-141-1/+1
| | | | | | | 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-122-0/+43
| | | | | | 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-121-4/+2
| | | | | | | | | | | 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-121-2/+3
| | | | | | | | | | | | | | | | | | 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-121-1/+1
| | | | | | | | | | 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-111-5/+15
| | | | | | | | | 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-101-1/+4
| | | | | | | 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-101-2/+5
| | | | | 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-081-1/+2
| | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
* avformat/ivfenc: Change the length fields to 32 bitsRaphaël Zumer2019-10-081-1/+2
| | | | | | | | | | 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-081-1/+2
| | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
* avformat/mpsubdec: Clear queue on errorMichael Niedermayer2019-10-081-0/+3
| | | | | | | | 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-081-3/+1
| | | | | | 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-081-0/+1
| | | | | | | 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-081-4/+4
| | | | | | | | 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-082-1/+20
| | | | | | | | 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-081-32/+32
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
OpenPOWER on IntegriCloud