aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* avformat/vividas: Check n_sb_blocks against input spaceMichael Niedermayer2019-09-241-4/+13
| | | | | | | | Fixes: OOM Fixes: 16726/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5719320750981120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hashenc: fix incorrect use of av_mallocz_array()Moritz Barsnick2019-09-231-3/+3
| | | | | | | Fixes CID 1453867, CID 1453866, CID 1453865. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dashdec: fix segfault when parsing segmentlistvectronic2019-09-231-1/+1
| | | | | | | | | index into segmentlists_tab was specified as 4 instead of 3 causing invalid access further fix to: 8135 Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/dashdec: fix pointer being freed was not allocatedvectronic2019-09-231-0/+1
| | | | | | | | prevent attempt to call xmlFree if val was not allocated fixes: 8135 Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: vectronic <hello.vectronic@gmail.com>
* avformat/y4m: do not try to seek if pts is less than 0Paul B Mahol2019-09-221-0/+2
| | | | Fixes #8193.
* avformat/latmenc: fix context used for loggingJames Almer2019-09-211-8/+8
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hashenc: add streamhash muxerMoritz Barsnick2019-09-204-12/+94
| | | | | | | | | Implemented as a variant of the hash muxer, reusing most functions, and making use of the previously introduced array of hashes. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hashenc: use an array of hashesMoritz Barsnick2019-09-201-28/+54
| | | | | | | | | | | | | | | | | Only the first element of the array is used currently, the other elements are in preparation for a new muxer calculating multiple hashes. Also move alloc/init code from the write_header() functions to dedicated init() functions, and the cleanup code from the write_trailer() functions to dedicated deinit() functions. hash_free() and framehash_free() turn out to be identical here, but will differ in the subsequent commit, so they are not consolidated. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hashenc: rearrange options definitionMoritz Barsnick2019-09-201-8/+27
| | | | | | | | | | Only the frame* muxers support the format_version option. Use macros to ease the proliferation of identical options to coming muxers as well. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtpenc_mpegts: copy metadata to mpegts sub-muxerMoritz Barsnick2019-09-201-0/+2
| | | | | | | Fixes #7293. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: parse replaygain metadataMoritz Barsnick2019-09-201-0/+5
| | | | | | 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/movenc: don't hardcode the colr box sizeJames Almer2019-09-191-4/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mpegts: add support for EPG extraction from mpegtsAnthony Delannoy2019-09-191-1/+59
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: add all well known PIDs and TIDs to mpegts.hAnthony Delannoy2019-09-191-6/+68
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: Preserve integrity of linked listAndreas Rheinhardt2019-09-181-4/+3
| | | | | | | | | | | | | | | | 1. Instead of relying on ff_packet_list_get to get the oldest element in an AVPacketList, ff_read_packet used its own ad-hoc code. Said code forgot to set the end of the list to NULL if the last element of the list has been removed, thereby leaving the list in an inconsistent state. 2. Furthermore, if the list was not empty, the oldest element of the list would always be copied into another packet structure before it was known whether the oldest entry of the list would be removed. This makes the ownership confusing and potentially copies unnecessarily. Both of these issues have been fixed. ff_packet_list_get is used now. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/internal: Improve documentation of ff_packet_list_getAndreas Rheinhardt2019-09-181-1/+4
| | | | | | | | | | | | | | | The documentation of ff_packet_list_get currently didn't match the actual usage: 1. It said that the destination packet is supposed to be initialized. But this makes no sense given that it will be overwritten completely and flacenc, mp3enc and ttaenc ignored this. 2. ff_packet_list_get returns an int, although it can't fail in case the packet list is not empty (for which there is an assert). Again, several callers didn't check for any return value. In both cases, the documentation has been adapted to match actual usage. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/mpegts: Support demuxing AVS2.hwrenx2019-09-181-0/+1
|
* avformat/mov: Check for EOF in mov_read_meta()Michael Niedermayer2019-09-171-1/+4
| | | | | | | | Fixes: Timeout (195sec -> 2ms) Fixes: 16735/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5090676403863552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Fix memleakAndreas Rheinhardt2019-09-171-1/+3
| | | | | | | | | | | When the mov/mp4 demuxer encounters an error during decrypting a packet, it returns the error, yet doesn't free the packet, so that the packet leaks. This has been fixed in this commit. Fixes the memleaks from ticket #8150. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/g729dec: Support decoding Sipro ACELP.KELVIN.Carl Eugen Hoyos2019-09-161-0/+1
| | | | | Fixes ticket #4799. Analyzed-by: Aleksandr Ustinov
* avformat/vividas: Remove align offset which is always masked offMichael Niedermayer2019-09-161-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: remove dead assignmentMichael Niedermayer2019-09-161-2/+0
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cdxl: Fix integer overflow in intermediateMichael Niedermayer2019-09-161-1/+2
| | | | | | | | Fixes: signed integer overflow: 65535 * 65312 cannot be represented in type 'int' Fixes: 16704/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6294115603447808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* repeat an even number of characters in occuredMichael Niedermayer2019-09-161-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hcom: Tell the compiler about set but not read variablesMichael Niedermayer2019-09-161-1/+1
| | | | | | This avoids 3 warnings Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rmdec.c: fix brackets around argumentsJames Almer2019-09-151-1/+1
| | | | | | Regression since 78f52b4fe3 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rmdec.c: fix left shift of negative value in rm_sync()James Almer2019-09-151-2/+2
| | | | | | | Fixes ticket 8143. Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hlsenc: make fix code style of hls_write_trailerSteven Liu2019-09-141-8/+8
| | | | change vs->avf to oc
* avformat/dashdec: reindent code at parse_manifestSteven Liu2019-09-141-1/+1
|
* lavf/hls: fix memory leak in error handling path for option tmpJun Zhao2019-09-141-3/+4
| | | | | | | fix memory leak in error handling path for option tmp. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: remove redundancy seekable settingJun Zhao2019-09-141-1/+0
| | | | | | | | ffio_init_context with NULL seek callback will setting seekable with 0, so remove the redundancy seekable setting. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: drop unnecessary check before ff_format_io_closeJun Zhao2019-09-141-12/+6
| | | | | | | | ff_format_io_close will check the AVIOContext pointer pb, so drop the unnecessary check before ff_format_io_close. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/hls: refine the log messageJun Zhao2019-09-141-3/+3
| | | | | | | refine the log message, it's will help the debugging Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hlsenc: Fix memleak when using single_fileAndreas Rheinhardt2019-09-141-0/+1
| | | | | | | | | | This commit fixes a memleak in the hls muxer when one uses a single file as output. It has been forgotten to free the temporary buffers used to write the packets so that the size of the leaks basically amounts to the size of the output file. This commit adds the necessary free. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* hlsenc: flush segments to guarantuee atomic single file hlsDaniel Oberhoff2019-09-141-0/+1
|
* avformat/sccdec: remove not needed codePaul B Mahol2019-09-131-1/+0
|
* avformat/dashdec: add startNumber parser for segmentlistSteven Liu2019-09-121-1/+9
| | | | | | | | and get start_number for compute current segment number. fix ticket: 7976 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: fix memleak at hls_write_trailerSteven Liu2019-09-121-0/+1
| | | | | Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: print warning at the end when upload the last segment failedSteven Liu2019-09-121-0/+2
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/hlsenc: merge fmp4 and mpegts segment type m3u8 list AVIOConextSteven Liu2019-09-121-11/+11
| | | | | | | hlsenc has been merge fmp4 and mpegts workflow before so it can merge m3u8 list AVIOContext now. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/avidec: fix memory leak in error handling pathJun Zhao2019-09-101-1/+3
| | | | | | | free the value in error handling path to avoid the memory leak. Signed-off-by: Jun Zhao <barryjzhao@tencent.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: check for tiny blocks using alignmentMichael Niedermayer2019-09-061-0/+4
| | | | | | | | | Ask for a sample for these Fixes: out of array access Fixes: 16624/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5762455661182976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>