summaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* 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>
OpenPOWER on IntegriCloud