summaryrefslogtreecommitdiff
path: root/libavcodec/movtextdec.c
Commit message (Collapse)AuthorAge
* lavc/movtextdec: allow setting subtitle frame dimensionsJohn Stebbins2020-04-10
| | | | | | | | Font sizes are relative to the subtitle frame dimensions. If the expected frame dimensions are not known, the font sizes will most likely be incorrect. Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: restore active style color after hiliteJohn Stebbins2020-04-10
| | | | Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: add color and alpha style tagsJohn Stebbins2020-04-10
| | | | Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: add alpha default to ass header colorsJohn Stebbins2020-04-10
| | | | Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: make sure default font name is setJohn Stebbins2020-04-10
| | | | Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: only write fontsize, fontID tags if not defaultJohn Stebbins2020-04-10
| | | | Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: handle changes to default style flagsJohn Stebbins2020-04-10
| | | | | | | Style flags were only being turned on. If the default was on and style record turned off, style flag remained on. Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: fix bold, italic, underline flagsJohn Stebbins2020-04-10
| | | | | | They should be 0 or 1 so that 0 or -1 is written to the ass header Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: simplify style record walkJohn Stebbins2020-04-10
| | | | | | | It's not necessary to walk the style record list twice per subtitle character. style records are in order and do not overlap. Signed-off-by: Philip Langdale <philipl@overt.org>
* lavc/movtextdec: fix ass header colorsJohn Stebbins2020-04-10
| | | | | | A conversion from rgb to bgr is necessary Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/movtextdec: Check style_start/endMichael Niedermayer2018-04-09
| | | | | | | | | | Limits based on 3GPP TS 26.245 V14.0.0 Fixes: Timeout Fixes: 6377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOVTEXT_fuzzer-5175929115508736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* movtextdec: fix handling of UTF-8 subtitleswm42018-03-25
| | | | | | | | | | | | | | | | Subtitles which contained styled UTF-8 subtitles (i.e. not just 7 bit ASCII characters) were not handled correctly. The spec mandates that styling start/end ranges are in "characters". It's not quite clear what a "character" is supposed to be, but maybe they mean unicode codepoints. FFmpeg's decoder treated the style ranges as byte idexes, which could lead to UTF-8 sequences being broken, and the common code dropping the whole subtitle line. Change this and count the codepoint instead. This also means that even if this is somehow wrong, the decoder won't break UTF-8 sequences anymore. The sample which led me to investigate this now appears to work correctly.
* movtextdec: Move declaration out of for initialisation statementMark Thompson2017-10-21
|
* avcodec/movtextdec: run mov_text_cleanup() before overwriting pointersMichael Niedermayer2017-03-09
| | | | | | | | Fixes: memleak Fixes: 741/clusterfuzz-testcase-586996200452915 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Call mov_text_cleanup() on closeMichael Niedermayer2017-03-06
| | | | | | | | Fixes memleak Fixes: 548/clusterfuzz-testcase-5511470875934720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Fix decode_styl() cleanupMichael Niedermayer2017-02-06
| | | | | | | | Fixes: null pointer dereference Fixes: 555/clusterfuzz-testcase-5986646595993600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Add error message for tsmb_size checkMichael Niedermayer2016-11-15
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Fix tsmb_size check==0 checkMichael Niedermayer2016-11-15
| | | | | | | Fixes: 173/fuzz-3-ffmpeg_SUBTITLE_AV_CODEC_ID_MOV_TEXT_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Fix potential integer overflowMichael Niedermayer2016-11-15
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/movtextdec.c: Avoid infinite loop on invalid data.Sasi Inguva2016-09-27
| | | | Signed-off-by: Sasi Inguva <isasi@google.com>
* lavc/options: add ass_ro_flush_noop to flags2Clément Bœsch2016-02-26
|
* lavc: allow subtitle text format to be ASS without timingClément Bœsch2016-02-26
|
* lavc/ccaption_dec: improve default styleClément Bœsch2016-01-10
| | | | Use monospaced font, and a black box outline.
* avcodec/movtextdec: Free ftab_tempMichael Niedermayer2015-08-31
| | | | | | | | Fixes memleak Fixes: efe937780e95574250dabe07151bdc23/unknown_unknown_351_849_cov_3187578556_shellymanne.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Make tx3g_ptr unsignedMichael Niedermayer2015-08-31
| | | | | | | | Fixes integer overflow Fixes: efe937780e95574250dabe07151bdc23/unknown_unknown_351_849_cov_3187578556_shellymanne.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* movtextdec: Add support for automatic text wrappingNiklesh2015-08-14
| | | | | | | | | | | The value of wrap_flag in the Text Wrap Box specifies if the text is to be wrapped or not. Uses 'end of line wrap' amongst the wrap styles supported by ASS if the text is to be wrapped, i.e; fill as much text in a line as possible, then break to next line. The 3GPP spec has no provision for smart wrapping. Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec: Use default style information from movtext headerNiklesh2015-08-12
| | | | | | | | As suggested, posting the combined patch with the fate changes. The patch sets the default style in ASS from the default style information present in the movtext header. Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* Revert "movtextdec: Use default style information from movtext header"Michael Niedermayer2015-08-10
| | | | | | | | The commit broke sub-movtext and sub-subripenc fate output differs between mips ad x86 so updating fate ref is not possible This reverts commit d670848d4c2757068ff43a68c05d01b28c809fb4.
* movtextdec: Use default style information from movtext headerNiklesh2015-08-09
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec: Fix memory leaks by freeing mem allocs correctlyNiklesh2015-08-07
| | | | | | Initialize m->count_f to 0 at the correct place to free memory allocs properly. Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* avcodec/movtextdec: check that ftab has been allocated before dereferencing itMichael Niedermayer2015-08-06
| | | | | | Fixes potential null pointer dereference on deallocation Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* movtextdec.c: Add support for font namesNiklesh2015-08-06
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec.c: Add support for fontsizeNiklesh2015-07-26
| | | | | | | | Add support for fontsize in style records. The patch uses reset to directly change back to default style instead of using closing tags, since we are not handling the default styles right now. Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec.c: Correct the highlight tagsNiklesh2015-07-20
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec.c: Add support for highlight and hilightcolor boxNiklesh2015-07-12
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* movtextdec.c: Improve upon dynarrays and text_to_assNiklesh2015-06-22
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* Improve upon dynamic arrays- movtext subtitlesNiklesh2015-05-25
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* avcodec/movtextdec: Add support for large boxes(>32 bit)Niklesh2015-05-22
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* Fix movtext crashes caused due to lack of proper bounds checkingNiklesh2015-05-19
| | | | Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
* avcodec/movtextdec: Decoding of Bold-Italic_Underlined styles for 3gpp timed ↵Niklesh2015-04-25
| | | | | | | | | text subtitles Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in> Previous version reviewed-by: Philip Langdale <philipl@overt.org> Previous version reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/ass: add ASS trailing \r\n in one single placeClément Bœsch2014-10-19
|
* avcodec/ass: assume raw=0 in ff_ass_add_rect_bprintClément Bœsch2014-10-19
|
* avcodec/movtextdec: add some memory checksClément Bœsch2014-09-21
|
* lavc/movtextdec: keep the min size instead of max to fix overread.Clément Bœsch2013-01-01
| | | | Fixes Ticket #2087.
* movtextdec: Don't emit errors for normal duration-end packets.Philip Langdale2012-08-15
| | | | | | | | The logic here was off. If the packet size is exactly two, then it's a well-formed empty subtitle, used to mark the end of the duration of the previous subtitle. Signed-off-by: Philip Langdale <philipl@overt.org>
* Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* movtextdec: fix return value for too small packets.Nicolas George2012-07-31
|
* movtextdec: 3GPP TS 26.245 Timed Text Decoder.Philip Langdale2012-07-14
This change introduces a basic decoder for 3GPP Timed Text subtitles, also known as TX3G, Quicktime subtitles, or "movtext" in the existing code. This initial change doesn't attempt to parse styling information, and just reads the plain text of the subtitles. I intend to add support for styles eventually, but it's challenging due to a lack of existing players that support them. Signed-off-by: Philip Langdale <philipl@overt.org>