summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
Commit message (Collapse)AuthorAge
* lavc/dvdsubdec: Move palette parsing to new functionMichael Kuron2020-02-04
| | | | | Signed-off-by: Michael Kuron <michael.kuron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: discard accumulated buffer on errorMichael Niedermayer2018-12-14
| | | | | | | | Fixes: Timeout Fixes: 10992/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5657495410835456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Sanity check len in decode_rle()Michael Niedermayer2018-09-19
| | | | | | | | Fixes: Timeout Fixes: 9778/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5186007132536832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Avoid branch in decode_run_8bit()Michael Niedermayer2018-09-15
| | | | | | | Speed improvment 35.5 sec -> 34.7sec Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Check for fully transparent rectangles earlierMichael Niedermayer2018-07-02
| | | | | | | | | | Testcase with large transparent rectangles changes from 67 sec to 3 sec decode time Fixes: Timeout Fixes: 8728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5190088756559872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Fix runtime error: left shift of 242 by 24 places cannot ↵Michael Niedermayer2017-05-05
| | | | | | | | | be represented in type 'int' Fixes: 1080/clusterfuzz-testcase-5353236754071552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places ↵Michael Niedermayer2017-04-07
| | | | | | | | | cannot be represented in type 'int' Fixes: 619/clusterfuzz-testcase-5803914534322176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
|
* avcodec/dvdsubdec: Fix off by 1 errorMichael Niedermayer2016-10-26
| | | | | | | Fixes out of array read Found-by: Thomas Garnier using libFuzzer Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: Fix buf_size checkMichael Niedermayer2016-10-26
| | | | | | | Fixes out of array access Found-by: Thomas Garnier using libFuzzer Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsubdec: ignore h <= 1 case, to properly decode subtitlePaul B Mahol2016-09-18
| | | | | | | | Fixes #5825. If h == 1, second decode_rle() fails. Regression since: 3f0a3e9e127d067c5cf65640a44765c1ddd01622. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/dvdsubdec: fix typo in dlog messageGanesh Ajjanagadde2015-12-06
| | | | | | | | | Likely accidental in 764900d6458a2f79166ff91df4f20ad39cd6acec. Fixes: CID 1341578. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
|
* avcodec/dvdsubdec: Fix types for offset1/2 in ff_dlog()Michael Niedermayer2015-11-22
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '5c30ae1a09b66179e16694f6137658023ed1fef3'Derek Buitenhuis2015-11-22
|\ | | | | | | | | | | | | | | | | | | * commit '5c30ae1a09b66179e16694f6137658023ed1fef3': dvdsubdec: Validate the RLE offsets Conflicts: libavcodec/dvdsubdec.c Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * dvdsubdec: Validate the RLE offsetsLuca Barbato2015-11-17
| | | | | | | | CC: libav-stable@libav.org
* | dvdsubdec: validate offset2 similar to offset1Andreas Cadhalpun2015-11-11
| | | | | | | | | | | | | | If it is negative, it causes segmentation faults in decode_rle. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit 'a17a7661906ba295d67afd80ac0770422e1b02b3'Hendrik Leppkes2015-10-22
|\| | | | | | | | | | | | | * commit 'a17a7661906ba295d67afd80ac0770422e1b02b3': lavc: Add data and linesize to AVSubtitleRect Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Add data and linesize to AVSubtitleRectVittorio Giovara2015-10-21
| | | | | | | | | | | | | | | | | | | | | | | | Use the new fields directly instead of the ones from AVPicture. This removes a layer of indirection which serves no pratical purpose whatsoever, and will help in removing AVPicture structure completely later. Every subtitle encoder/decoder seamlessly points to the new arrays, so it is possible to deprecate AVSubtitleRect.pict. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/dvdsubdec: don't use a NULL log contextwm42015-09-22
| |
* | avcodec/dvdsubdec: reject some broken packetswm42015-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | If cmd_pos is broken, this would just keep accumulating packets in the reassembly buffer, until it fails and flushes the buffer on overflow. Since packets are usually rather small, this will take a lot of subtitle packets. The perceived effect is that subtitles are not displayed anymore after the faulty packet was passed to the decoder. I'm not terribly sure about this, but on the other hand this code is active only when fragmented packets need to be reassembled. Fixes sample file in trac issue #4872.
* | avcodec/dvdsub: fix partial packet assemblywm42015-09-22
| | | | | | | | | | | | | | | | | | | | Assuming the first and second packets are partial, this would append the reassembly buffer (ctx->buf) to itself with the second append_to_cached_buf() call, because buf is set to ctx->buf. I do not know a valid sample file which triggers this, and do not know if packets can be split into more than 2 sub-packets, but it triggered with a (differently) broken sample file in trac issue #4872.
* | avcodec/dvdsubdec: fix indentationwm42015-09-21
| |
* | dvdsubdec: implement flushingwm42015-05-28
| | | | | | | | | | | | This is needed for proper operation with seeking. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | dvdsubdec: reset buffer size on invalid over-large packetswm42015-05-28
| | | | | | | | | | | | | | | | Otherwise it will never be reset, and remain "stuck" in this state forever. Can happen when seeking: the decoder will receive fragments from different file positions, which triggers the condition easily. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | Merge commit 'ec17782e17de1e8501ca213e276dfe5412ff1d11'Michael Niedermayer2015-02-17
|\| | | | | | | | | | | | | | | | | | | * commit 'ec17782e17de1e8501ca213e276dfe5412ff1d11': dvdsubdec: Check memory allocations Conflicts: libavcodec/dvdsubdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dvdsubdec: Check memory allocationsVittorio Giovara2015-02-17
| |
* | avcodec/dvdsubdec: fix accessing dangling pointerswm42015-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dvdsub_decode() can call append_to_cached_buf() 2 times, the second time with ctx->buf as argument. If the second append_to_cached_buf() reallocs ctx->buf, the argument will be a pointer to the previous, freed block. This can cause invalid reads at least with some fuzzed files - and possibly with valid files. Since packets can apparently not be larger than 64K (even if packets are combined), just use a fixed size buffer. It will be allocated as part of the DVDSubContext, and although some memory is "wasted", it's relatively minimal by modern standards and should be acceptable. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: error on bitmaps with size 0wm42015-01-08
| | | | | | | | | | | | | | Attemtping to decode them could lead to invalid writes with some fuzzed samples. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: fix out of bounds accesseswm42015-01-05
| | | | | | | | | | | | | | | | The code blindly trusted buffer offsets read from the file in the RLE decoder. Explicitly check the offset. Also error out on other RLE decoding errors. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: Avoid strerror() due to thread safteyMichael Niedermayer2014-12-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3'Michael Niedermayer2014-11-21
|\| | | | | | | | | | | | | | | | | | | | | * commit 'd466d82faaf6e0e57a3a4be5e38e3902ef251ac3': dvdsubdec: Do not leak on failure path Conflicts: libavcodec/dvdsubdec.c See: 7fa9f7ef1c2f0cee81ec6ea6a4ff10af4c4fc62c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dvdsubdec: Do not leak on failure pathLuca Barbato2014-11-21
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1198262
| * cosmetics: Write NULL pointer inequality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/dvdsubdec: Check all fseek()s return codesMichael Niedermayer2014-11-16
| | | | | | | | | | | | Fixes CID1254660 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: New option for obtaining global palette from .IFO file ↵Shin-ichi Toyama2014-11-15
| | | | | | | | | | | | | | (experimental) Suggested-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libavcodec/dvdsubdec: Add option forced_subs_only to only decode forced ↵Nicholas Robbins2014-09-22
| | | | | | | | | | | | | | subtitle frames. Signed-off-by: Nicholas Robbins <nickrobbins@yahoo.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: fix VD/SD identifier nameMichael Niedermayer2014-09-19
| | | | | | | | | | Found-by: Nicholas Robbins <nickrobbins-at-yahoo.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: Dont mix integers with pointersMichael Niedermayer2014-08-16
| | | | | | | | | | Reviewed-by: James Darnley <james.darnley@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/dvdsubdec: free subtitle rectangles if nothing is outputMichael Niedermayer2014-07-31
| | | | | | | | | | Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: fix alpha in debuging codeOliver Fromme2014-07-04
| | | | | | | | | | | | | | improve the debugging function for saving subtitles to PPM files: Actually use the alpha channel. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dvdsubdec: Fix off-by-one errorOliver Fromme2014-07-04
| | | | | | | | | | | | | | | | Fix an off-by-one error that causes the height of decoded subtitles to be too small, thus cutting off the lowest row of pixels. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '3dc6272bed7890a49080e18eacf3c7a4a6594b0d'Michael Niedermayer2014-04-05
|\| | | | | | | | | | | | | | | | | | | | | * commit '3dc6272bed7890a49080e18eacf3c7a4a6594b0d': Remove a number of unnecessary dsputil.h #includes Conflicts: libavcodec/h264pred.c libavcodec/vc1dsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove a number of unnecessary dsputil.h #includesDiego Biurrun2014-04-04
| |
* | Merge commit '05563ccacc98fd185affdbf8cbaf094caf36b852'Michael Niedermayer2014-03-14
|\| | | | | | | | | | | | | | | | | | | | | * commit '05563ccacc98fd185affdbf8cbaf094caf36b852': dsputil: cosmetics: Lose camelCase on ff_cropTbl and ff_squareTbl names Conflicts: libavcodec/bit_depth_template.c libavcodec/motionpixels_tablegen.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: cosmetics: Lose camelCase on ff_cropTbl and ff_squareTbl namesDiego Biurrun2014-03-13
| | | | | | | | Also switch from "tbl" to "tab" name suffixes.