Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-07avformat/sccdec: Remove nonsense castAndreas Rheinhardt
In most contexts, arrays are automatically converted to a pointer to their first element; taking the address of the array just yields a pointer to an array of fixed-size arrays, which is not intended here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02avformat/sccdec: Avoid zero-terminating unnecessarilyAndreas Rheinhardt
ff_subtitles_queue_insert() does not require its events to be zero-terminated as it has a parameter for the length. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02avformat/sccdec: Make constants more intelligibleAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02avformat/sccdec: Fix position of returned subtitle packetsAndreas Rheinhardt
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02avformat/sccdec: Remove redundant checkAndreas Rheinhardt
The av_sscanf() will filter lines like "Scenarist_SCC V1.0" out. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-02avformat/sccdec: Don't use uninitialized data, fix crash, simplify logicAndreas Rheinhardt
Up until now, the scc demuxer not only read the line that it intends to process, but also the next line, in order to be able to calculate the duration of the current line. This approach leads to unnecessary complexity and also to bugs: For the last line, the timing of the next subtitle is not only logically indeterminate, but also uninitialized and the same applies to the duration of the last packet derived from it.* Worse yet, in case of e.g. an empty file, it is not only the duration that is uninitialized, but the whole timing as well as the line buffer itself.** The latter is used in av_strtok(), which could lead to crashes. Furthermore, the current code always outputs at least one packet, even for empty files. This commit fixes all of this: It stops using two lines at a time; instead only the current line is dealt with and in case there is a packet after that, the duration of the last packet is fixed up after having already parsed it; consequently the duration of the last packet is left in its default state (meaning "unknown/up until the next subtitle"). If no further line could be read, processing is stopped; in particular, no packet is output for an empty file. *: Due to stack reuse it seems to be zero quite often; for the same reason Valgrind does not report any errors for a normal input file. **: While ff_subtitles_read_line() claims to always zero-terminate the buffer like snprintf(), it doesn't do so if it didn't read anything. And even if it did, it would not necessarily help here: The current code jumps over 12 bytes that it deems to have read even when it hasn't. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08avformat/sccdec: Simplify cleanup after read_header failureAndreas Rheinhardt
by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27avformat: Constify all muxer/demuxersAndreas Rheinhardt
This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-02avformat/sccdec: Use larger intermediate for ts/next_ts computationMichael Niedermayer
Fixes: signed integer overflow: 92237203 * 33 cannot be represented in type 'int' Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SCC_fuzzer-6603769487949824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-22avformat/sccdec: Avoid variable that is always zeroAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-18avformat/sccdec: make splitting more robustPaul B Mahol
2020-06-17avformat/sccdec: simplify demuxer a littlePaul B Mahol
2020-06-15avformat/sccdec: unbreak previous commits to this filePaul B Mahol
2020-06-15avformat/sccdec: Fix memleak upon read header failureAndreas Rheinhardt
The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon reading a subsequent subtitle. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-13avformat/sccdec: move pos variables outside of loopPaul B Mahol
Ensures that sub->pos is always correct.
2020-06-13avformat/sccdec: split line with multiple subsPaul B Mahol
2020-02-04avformat/sccdec: use av_sscanf() insteadPaul B Mahol
2019-12-24avformat/sccdec: only change duration for last subtitlePaul B Mahol
2019-12-24avformat/sccdec: fix sub->pos valuesPaul B Mahol
2019-12-24avformat/sccdec: fix timestamp of last subtitlePaul B Mahol
Fixes -c:s copy case.
2019-09-13avformat/sccdec: remove not needed codePaul B Mahol
2019-06-27avformat/sccdec: display last caption even when there is no empty last linePaul B Mahol
2019-03-21lavf: Constify the probe function argument.Carl Eugen Hoyos
Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
2017-01-30avformat/sccdec: simplify 2 sscanf callsPaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-28avformat/sccdec: attempt to fix valgrind issuePaul B Mahol
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-01-25avformat: add Scenarist Closed Captions demuxerPaul B Mahol
Fixes #4767. Signed-off-by: Paul B Mahol <onemda@gmail.com>