aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tedcaptionsdec.c
Commit message (Collapse)AuthorAgeFilesLines
* libavformat: fix incorrect handling of incomplete AVBPrint.Reimar Döffinger2023-07-291-1/+1
| | | | | | | | | | | | | Change some internal APIs a bit to make it harder to make such mistakes. In particular, have the read chunk functions return an error when the result is incomplete. This might be less flexible, but since there has been no use-case for that so far, avoiding coding mistakes seems better. Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bprint). Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-171-2/+4
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tedcaptionsdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-081-1/+1
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: move AVStream.{first,cur}_dts to AVStreamInternalJames Almer2021-06-091-1/+1
| | | | | | They are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: move AVStream.probe_packets to AVStreamInternalJames Almer2021-05-071-1/+1
| | | | | | It's a private fields, no reason to have it exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* avformat/subtitles: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tedcaptionsdec: Check for overflow in parse_int()Michael Niedermayer2021-01-291-0/+2
| | | | | | | | Fixes: signed integer overflow: 1111111111111111111 * 10 cannot be represented in type 'long' Fixes: 26892/clusterfuzz-testcase-minimized-ffmpeg_dem_TEDCAPTIONS_fuzzer-5756045055754240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/tedcaptionsdec: Fix leak of AVBPrint upon errorAndreas Rheinhardt2020-09-201-37/+36
| | | | | | | | | | | | | | | | The tedcaptions demuxer uses an AVBPrint whose string is not restricted to its internal buffer; it therefore needs to be cleaned up, yet this is not done on error, as parse_file() returned simply returned directly. This is fixed by going to fail first in such cases. Furthermore, there is also a second way how this string can leak: By having more than one subtitle per subtitle block, as the new one simply overwrites the old one in this case as the AVBPrint is initialized each time upon encountering a subtitle line. The code has been modified to simply append the new subtitle to the old one, so that the old one can't leak any more. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/tedcaptionsdec: Fix memleak upon read header failureAndreas Rheinhardt2020-06-151-4/+4
| | | | | | | The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if allocating the AVStream for the subtitles fails. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-211-1/+1
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf/tedcaptionsdec: Replace the number by macro for bprint initJun Zhao2018-06-171-1/+1
| | | | | | Replace the number by macro for bprint init. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-2/+2
| | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/subtitles: forward log context in ff_subtitles_queue_finalize() for ↵Clément Bœsch2015-09-101-1/+1
| | | | logging
* FF_OPT_TYPE_* -> AV_OPT_TYPE_*.Ronald S. Bultje2015-08-181-1/+1
|
* avformat/tedcaptionsdec: add () to protect the argument of ERR_CODE()Michael Niedermayer2015-02-171-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/tedcaptionsdec: make const arrays static constMichael Niedermayer2013-08-101-1/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat: replace "AVPROBE_SCORE_MAX / X" by AVPROBE_SCORE_EXTENSION / YMichael Niedermayer2013-05-051-1/+1
| | | | | | Demuxers where the changed code looked less readable where skiped Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf: add AV_ to two remaining CODEC_ID_*.Nicolas George2013-03-121-1/+1
|
* lavf: TED Talks JSON captions demuxer.Nicolas George2012-12-091-0/+365