summaryrefslogtreecommitdiff
path: root/libavformat/oggparsetheora.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-171-1/+1
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: move AVStream.{parser,need_parsing} to AVStreamInternalJames Almer2021-05-071-1/+1
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/oggparsetheora: Don't update start time when lastpts is AV_NOPTS_VALUE.Dale Curtis2020-05-311-1/+1
| | | | | Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Use av_sat_sub64() when updating pts by duration.Dale Curtis2020-05-291-1/+1
| | | | | Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/oggparsetheora: Replace get_bits_long() by get_bits() where possibleMichael Niedermayer2019-12-311-5/+5
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/oggparsetheora: Do not adjust AV_NOPTS_VALUEMichael Niedermayer2018-03-101-1/+5
| | | | | | | | Fixes: Chromium bug 795653 Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-14/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-231-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | oggparsedaala: reject too large gpshiftAndreas Cadhalpun2016-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | Also use a unsigned constant for the shift calculation, as 1 << 31 is undefined for int32_t. This is also fixed oggparsetheora. This fixes ubsan runtime error: shift exponent is too large for 32-bit type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/oggparsetheora: Check duration to be not AV_NOPTS_VALUE (and ↵Michael Niedermayer2015-12-041-1/+1
| | | | | | | | | | | | | | | | | | positive) before use Fixes: 1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_7322_4fad88a38dc8952dc20dcb60c1895758.ogg Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-271-1/+1
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'db68ef898a3802e51b6f41fd600d0d46d058e3f8'Michael Niedermayer2014-08-141-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'db68ef898a3802e51b6f41fd600d0d46d058e3f8': ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes. Conflicts: libavformat/oggparsevorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.Andrew Stone2014-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, AVFormatContext and a metadata dict were provided to ff_vorbis_comment(), but this presented issues if an AVStream was being updated or the metadata on AVFormatContext wasn't actually being updated. To remedy this, ff_vorbis_stream_comment() explicitly updates a stream's metadata and sets any necessary flags. ff_vorbis_comment() does not modify any flags, and any calls to it that update AVFormatContext's metadata (just a single call) must also update AVFormatContext.event_flags after detecting any metadata changes to the provided dictionary, as signaled by a positive return value. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '23f741f79327e31be7b2a75ebb2e02111e06e52f'Michael Niedermayer2014-05-281-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '23f741f79327e31be7b2a75ebb2e02111e06e52f': matroskadec: parse the channel layout mask for FLAC Conflicts: libavformat/oggparsevorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: parse the channel layout mask for FLACAnton Khirnov2014-05-281-1/+1
| | | | | | | | It is commonly stored in a vorbiscomment block in codec private data.
* | avformat/oggparsetheora: zero extradata padding areaMichael Niedermayer2013-12-151-0/+2
| | | | | | | | | | | | | | Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f66fa0ac09d_9197_theora_a4_v6_k250_s0.ogg Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ce6949d3a0607eb318dc2872553110df934e9720'Michael Niedermayer2013-11-011-8/+8
|\ \ | |/ | | | | | | | | | | * commit 'ce6949d3a0607eb318dc2872553110df934e9720': oggparsetheora: stop using deprecated avcodec_set_dimensions Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oggparsetheora: stop using deprecated avcodec_set_dimensionsAnton Khirnov2013-10-311-8/+8
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-301-0/+2
|\ \ | |/ | | | | | | | | | | * qatar/master: oggparsetheora: check av_mallocz result Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oggparsetheora: check av_mallocz resultAnton Khirnov2013-10-301-0/+2
| |
* | Merge commit '5e5fb21877d8da7b3b8a27bb4d6a070d210c152d'Michael Niedermayer2013-10-301-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '5e5fb21877d8da7b3b8a27bb4d6a070d210c152d': oggparsetheora: return meaningful error codes Conflicts: libavformat/oggparsetheora.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oggparsetheora: return meaningful error codesAnton Khirnov2013-10-301-3/+3
| |
* | Merge commit 'd4c12b8be4bdd2ffddb3bd5e11773de4c4c46f68'Michael Niedermayer2013-10-301-53/+54
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'd4c12b8be4bdd2ffddb3bd5e11773de4c4c46f68': oggparsetheora: K&R cosmetics, reformat Conflicts: libavformat/oggparsetheora.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oggparsetheora: K&R cosmetics, reformatAnton Khirnov2013-10-301-53/+53
| | | | | | | | | | | | | | | | Also typedef the private data struct and make its name consistent with the rest of Libav. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9'Michael Niedermayer2013-09-271-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'd872fb0f7ff2ff0ba87f5ccf6a1a55ca2be472c9': lavf: Reset the entry count and allocation size variables on av_reallocp failures Conflicts: libavformat/avienc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Reset the entry count and allocation size variables on av_reallocp ↵Martin Storsjö2013-09-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | failures When av_reallocp fails, the associated variables that keep track of the number of elements in the array (and in some cases, the separate number of allocated elements) need to be reset. Not all of these might technically be needed, but it's better to reset them if in doubt, to make sure variables don't end up conflicting. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '5626f994f273af80fb100d4743b963304de9e05c'Michael Niedermayer2013-09-191-3/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit '5626f994f273af80fb100d4743b963304de9e05c': avformat: Use av_reallocp() where suitable Conflicts: libavformat/avidec.c libavformat/avienc.c libavformat/aviobuf.c libavformat/oggparsevorbis.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Use av_reallocp() where suitableAlexandra Khirnova2013-09-181-3/+4
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * oggparsetheora: fix comment header parsingGiorgio Vazzana2013-01-141-1/+1
| | | | | | | | | | | | Pass the correct header size to ff_vorbis_comment() Signed-off-by: Martin Storsjö <martin@martin.st>
* | oggparsetheora: fix comment header parsingGiorgio Vazzana2012-10-051-1/+1
| | | | | | | | | | | | Pass the correct header size to ff_vorbis_comment() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | oggparsetheora: print error when failing on unknown headerMichael Niedermayer2012-09-251-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-251-4/+12
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: pthread: make sure AVFrame.extended_data is set properly. libfdk-aac: reindent after last commit libfdk-aac: Limit to supported sample rates. cbrt_tablegen: Include libm.h oggparsetheora: make it more robust ogg: prevent NULL pointer deference in theora gptopts Conflicts: libavformat/oggparsetheora.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * oggparsetheora: make it more robustLuca Barbato2012-09-241-3/+12
| |
| * ogg: prevent NULL pointer deference in theora gptoptsMichael Niedermayer2012-09-241-2/+7
| | | | | | | | | | | | | | | | Additional safety in case a special ogg stream is crafted with the proper number of Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '7751e4693dd10ec98c20fbd9887233b575034272'Michael Niedermayer2012-09-251-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7751e4693dd10ec98c20fbd9887233b575034272': ogg: check that the expected number of headers had been parsed libx264: change default to closed gop to match x264cli Use avcodec_free_frame() to free AVFrames. lavf: use a malloced AVFrame in try_decode_frame(). lavc: add avcodec_free_frame(). lavc: ensure extended_data is set properly on decoding lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults() lavc: use av_mallocz to allocate AVFrames. lavc: rename the argument of avcodec_alloc_frame/get_frame_defaults Conflicts: doc/APIchanges doc/examples/decoding_encoding.c libavcodec/utils.c libavcodec/version.h libavfilter/src_movie.c libavformat/oggdec.c libavformat/oggdec.h libavformat/oggparsetheora.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ogg: check that the expected number of headers had been parsedLuca Barbato2012-09-241-1/+2
| | | | | | | | Not having the header for a codec is a tell-tale of a broken file.
* | oggparsetheora: fix metadata parsingMichael Niedermayer2012-08-121-1/+1
| | | | | | | | | | Fixes Ticket1508 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | 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
| |
* | oggtheora: Port changes from oggvorbis timestamp handling.Michael Niedermayer2012-05-051-17/+12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | oggtheora: Fix initial ptsMichael Niedermayer2012-05-041-0/+42
| | | | | | | | | | | | code based on the solution in vorbis Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vorbisdemux: Check private context in theoras gtopts.Michael Niedermayer2012-03-231-2/+7
|/ | | | | | | | | This prevents a null ptr dereference. It could be checked differently but this way it should be possible to return some data. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* ogg: don't set codec timebaseAnton Khirnov2012-03-021-6/+7
| | | | Demuxers are not supposed to set it.
* lavf: make av_set_pts_info private.Anton Khirnov2011-11-301-1/+2
| | | | It's supposed to be called only from (de)muxers.
* Always use av_set_pts_info to set the stream time base.Reimar Döffinger2011-02-061-1/+1
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.Jean-Daniel Dupas2010-03-311-1/+1
| | | | | | Patch by Jean-Daniel Dupas, devlists shadowlab org Originally committed as revision 22744 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Define AVMediaType enum, and use it instead of enum CodecType, whichStefano Sabatini2010-03-301-1/+1
| | | | | | is deprecated and will be dropped at the next major bump. Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
* oggdec: Metadata is per-stream; don't merge multiple streams' togetherDavid Conrad2010-03-121-1/+1
| | | | Originally committed as revision 22473 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add ff_ prefix to vorbis_commentDavid Conrad2010-03-121-1/+1
| | | | Originally committed as revision 22472 to svn://svn.ffmpeg.org/ffmpeg/trunk