summaryrefslogtreecommitdiff
path: root/libavformat/mpsubdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)Andreas Rheinhardt2021-07-181-24/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpsubdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-081-3/+1
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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/mpsubdec: Use av_sat_add/sub64() in fracval handlingMichael Niedermayer2021-01-261-2/+2
| | | | | | | | Fixes: signed integer overflow: 9223372036850000000 + 9000000 cannot be represented in type 'long long' Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MPSUB_fuzzer-665448017480908 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpsubdec: Fix memleak upon read header failureAndreas Rheinhardt2020-06-151-2/+4
| | | | | | | The already parsed subtitles (contained in an FFDemuxSubtitlesQueue) would leak if an error happened upon creating an AVStream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* 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/mpsubdec: Remove floating point usageMichael Niedermayer2019-08-291-17/+67
| | | | | | | | | | | This makes the code bitexact between platforms. Intermediate timestamps between frames are preserved. The timebase is simplified. Rounding differs from doubles in cases where timestamps/durations are "funny" Suggested-by: jb Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mpsubdec: Check pts / duration before castMichael Niedermayer2019-08-231-2/+9
| | | | | | | | Fixes: 3e+47 is outside the range of representable values of type 'int' Fixes: 16057/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5691111307214848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-211-1/+1
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* 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
* avformat/mpsubdec: Use double instead of float for timestamp calculationsMichael Niedermayer2015-05-271-3/+3
| | | | | | | This provides higher precission Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/mpsubdec: change multipler to int, it only stores 1 and 100Michael Niedermayer2015-05-271-2/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* replace calls to url_feof() with avio_feof()James Almer2014-08-081-1/+1
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/subtitles: add a next line jumper and use it.Clément Bœsch2013-09-081-1/+6
| | | | | | | | | | | | This fixes a bunch of possible overread in avformat with the idiom p += strcspn(p, "\n") + 1 (strcspn() can focus on the trailing '\0' if no '\n' is found, so the +1 leads to an overread). Note on lavf/matroskaenc: no extra subtitles.o Makefile dependency is added because only the header is required for ff_subtitles_next_line(). Note on lavf/mpsubdec: code gets slightly complex to avoid an infinite loop in the probing since there is no more forced increment.
* lavf/mpsub: remove sscanf from probing.Clément Bœsch2013-05-061-4/+3
| | | | This should make probing faster.
* 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>
* Add MPlayer subtitles demuxer.Clément Bœsch2012-12-301-0/+140