summaryrefslogtreecommitdiff
path: root/libavformat/jacosubdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/jacosubdec: Fix overflow in get_shift()Michael Niedermayer2022-09-241-1/+1
| | | | | | | | Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-6722544461283328 Fixes: signed integer overflow: 48214448 * 60 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* all: Remove unnecessary libavcodec/internal.h inclusionsAndreas Rheinhardt2022-02-081-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jacosubdec: Check for min in t overflow in get_shift()Michael Niedermayer2021-09-131-0/+3
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)Andreas Rheinhardt2021-07-181-25/+4
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/jacosubdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-071-6/+3
| | | | | | 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/jacosubdec: Use 64bit intermediate for start/end timestamp shiftMichael Niedermayer2021-03-281-2/+2
| | | | | | | | Fixes: signed integer overflow: -1957694447 + -1620425806 cannot be represented in type 'int' Fixes: 30207/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5050791771635712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jacosubdec: Fix leak on errorAndreas Rheinhardt2021-03-261-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/subtitles: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/jacosubdec: Fix unintended fallthroughAndreas Rheinhardt2020-10-301-3/+9
| | | | | | | | | Regression since 715ff75e5dbbbefff7337351db596a9b7a5d4379. Fixes Coverity issues #1468654 and #1468656. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/jacosubdec: Use 64bit inside get_shift()Michael Niedermayer2020-10-241-4/+8
| | | | | | | | Fixes: signed integer overflow: 111111111 * 30 cannot be represented in type 'int' Fixes: 26448/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5638440374501376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jacosubdec: 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 reading a subsequent subtitle. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/jacosubdec: Fix timeres to 1/100 units convertion overflowMichael Niedermayer2019-06-211-4/+5
| | | | | | | | Fixes: signed integer overflow: 44444442 * 100 cannot be represented in type 'int' Fixes: 15117/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5164660531134464 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
* lavf/jacosubdec: compute subtitle duration correctlyAdam Sampson2019-02-201-1/+1
| | | | | | | | | | | | | | | | | | When a JACOsub subtitle has two timestamps, they represent its start and end times (http://unicorn.us.com/jacosub/jscripts.html#l_times); the duration is the difference between the two, not the sum of the two. The subtitle end times in the FATE test for this were wrong as a result; fix them too. (This test is based on JACOsub's demo.txt, and the end time computed for the last line using @ now matches what the comments there say it should be.) Also tested in practice using MPV, a LaserDisc, and some authentic 1993 JACOsub files. Signed-off-by: Adam Sampson <ats@offog.org> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-3/+3
| | | | | | | | | | | | | | | | * 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>
* Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-291-1/+1
| | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* avformat/subtitles: forward log context in ff_subtitles_queue_finalize() for ↵Clément Bœsch2015-09-101-1/+1
| | | | logging
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jacosubdec: Cleanup when avpriv_bprint_to_extradata() failsMichael Niedermayer2014-11-251-1/+4
| | | | | | | Fixes memleaks Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind 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/jacosubdec: make probing less tolerant.Clément Bœsch2013-11-191-1/+2
| | | | | | | | | | Fixes a failure with probetest: ./tools/probetest 8192 500000 [...] Failure of jacosub probing code with score=51 type=1 p=CAB size=16 Random data was: 00000000 40 37 40 30 93 01 48 e0 09 96 10 90 78 0f 0c 10 @7@0..H.....x...
* avformat/subtitles: add a next line jumper and use it.Clément Bœsch2013-09-081-1/+1
| | | | | | | | | | | | 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.
* 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: remove generic index flag from text subtitles.Clément Bœsch2013-01-021-1/+0
| | | | This flag is not necessary.
* 10l: export ff_bprint_to_extradata between libs using avpriv_ prefix.Clément Bœsch2012-12-301-1/+1
| | | | Both libavformat and libavcodec requires this function.
* lavc: add ff_bprint_to_extradata() helper and use it.Clément Bœsch2012-12-301-3/+5
| | | | | | | | | | This commit also makes sure the extradata and subtitle_header are NUL terminated, without taking into account the trailing '\0' in account in the size. At the same time, it should fix 'warning: dereferencing type-punned pointer will break strict-aliasing rules' warning for compilers who don't consider uint8_t** and char** compatibles.
* lavf: use ff_subtitles_queue_seek() for text subtitles demuxers.Clément Bœsch2012-12-021-0/+9
|
* Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/jacosubdec: fix FPE in case timeres is badly set.Clément Bœsch2012-06-291-1/+4
|
* lavf/jacosubdec: use subtitles queue API.Clément Bœsch2012-06-291-74/+24
|
* jacosub_probe: slightly increase the score to limit misdetection.Clément Bœsch2012-05-311-1/+1
|
* jacosub_probe: speedup by making only one call to sscanfClément Bœsch2012-05-311-2/+5
|
* JACOsub demuxer, decoder and muxer.Clément Bœsch2012-05-031-0/+304