summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsub_parser.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/dvdsub_parser: Fix length check for short packetsAidan MacDonald2022-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | The DVD subtitle parser handles two types of packets: "normal" packets with a 16-bit length, and HD-DVD packets that set the 16-bit length to 0 and encode a 32-bit length in the next four bytes. This implies that HD-DVD packets are at least six bytes long, but the code didn't actually verify this. The faulty length check results in an out of bounds read for zero-length "normal" packets that occur in the input, which are only 2 bytes long, but get misinterpreted as an HD-DVD packet. When this happens the parser reads packet_len from beyond the end of the input buffer. The subtitle stream is not correctly decoded after this point due to the garbage packet_len. Fixing this is pretty simple: fix the length check so packets less than 6 bytes long will not be mistakenly parsed as HD-DVD packets. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec: Constify all the AVCodecParsersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | Possible now that the next pointer no longer exists. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dvdsub_parser: Remove empty init functionAndreas Rheinhardt2020-07-041-6/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dvdsub_parser: Allocate input paddingMichael Niedermayer2018-07-151-1/+5
| | | | | | | | Fixes: out of array read Fixes: 9350/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5746777750765568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsub_parser: Init output buf/sizeMichael Niedermayer2018-07-151-0/+3
| | | | | | No testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdsub_parser: print message if packet is smaller than the packet ↵Michael Niedermayer2014-08-021-0/+2
| | | | | | size field Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/dvdsub_parser: Check buf_size before reading 32bit packet sizeMichael Niedermayer2014-08-021-1/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/dvdsub_parser: never return 0 when the input isnt 0Michael Niedermayer2014-08-021-1/+1
| | | | | | | Fixes a infinite loop Fixes Ticket3804 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-161-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't include common.h from avutil.hMartin Storsjö2012-08-151-0/+3
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | 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>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-1/+1
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-031-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (44 commits) replacement Indeo 3 decoder gsm demuxer: do not allocate packet twice. flvenc: use first packet delay as global delay. ac3enc: doxygen update. imc: return error codes instead of 0 for error conditions. imc: return meaningful error codes instead of -1 imc: do not set channel layout for stereo imc: validate channel count imc: check for ff_fft_init() failure imc: check output buffer size before decoding imc: use DSPContext.bswap16_buf() to byte-swap packet data rtsp: add allowed_media_types option libgsm: add flush function to reset the decoder state when seeking libgsm: simplify decoding by using a loop gsm: log error message when packet is too small libgsmdec: do not needlessly set *data_size to 0 gsmdec: do not needlessly set *data_size to 0 gsmdec: add flush function to reset the decoder state when seeking libgsmdec: check output buffer size before decoding gsmdec: log error message when output buffer is too small. ... Conflicts: Changelog ffplay.c libavcodec/indeo3.c libavcodec/mjpeg_parser.c libavcodec/vp3.c libavformat/cutils.c libavformat/id3v2.c libavutil/parseutils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove some stray unnecessary ffmpeg references.Diego Biurrun2011-11-021-1/+1
| |
| * lavc: use designated initialisers for parsers.Anton Khirnov2011-11-021-5/+5
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.Diego Elio Pettenò2011-01-261-1/+1
| | | | | | | | | | | | | | None of these symbols should be accessed directly, so declare them as hidden. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.Diego Elio Pettenò2011-01-281-1/+1
|/ | | | | | | | None of these symbols should be accessed directly, so declare them as hidden. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit d36beb3f6902b1217beda576aa18abf7eb72b03c)
* Add missing av_cold in static init/close functions.Daniel Verkamp2009-02-221-2/+2
| | | | | | Patch by Daniel Verkamp daniel at drv dot nu. Originally committed as revision 17526 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Remove pointless period after copyright statement non-sentences.Diego Biurrun2009-01-191-1/+1
| | | | Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix build: Add intreadwrite.h and bswap.h #includes where necessary.Diego Biurrun2009-01-111-0/+2
| | | | Originally committed as revision 16556 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Update the dvdsub parser to be able to parse HD-DVD subtitle packets.Ian Caulfield2007-07-241-0/+2
| | | | | | Patch by: Ian Caulfield, ian caulfield & gmx at Originally committed as revision 9790 to svn://svn.ffmpeg.org/ffmpeg/trunk
* make some parser parameters const to avoid casting const to non-constAurelien Jacobs2007-05-071-1/+1
| | | | Originally committed as revision 8921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move dvdsub parser to its own file.Diego Biurrun2007-05-061-0/+81
Originally committed as revision 8910 to svn://svn.ffmpeg.org/ffmpeg/trunk