summaryrefslogtreecommitdiff
path: root/libavcodec/pgssubdec.c
Commit message (Collapse)AuthorAge
* avcodec/pgssubdec: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove deprecated AVPicture APIAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in a17a7661906ba295d67afd80ac0770422e1b02b3. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/pgssubdec: replace data_size with got_sub_ptr for better readabilityLimin Wang2020-03-25
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pgssubdec: Free subtitle on errorMichael Niedermayer2020-01-05
| | | | | | | | | Fixes: Assertion failure Fixes: 19753/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5688461843759104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pgssubdec: Check for duplicate display segmentsMichael Niedermayer2019-02-03
| | | | | | | | | | In such a duplication the previous gets overwritten and leaks Fixes: memleak Fixes: 12510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5694439226343424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* pgssubdec: reset rle_data_len/rle_remaining_len on allocation errorAndreas Cadhalpun2017-02-01
| | | | | | | | The code relies on their validity and otherwise can try to access a NULL object->rle pointer, causing segmentation faults. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* pgssubdec: only set w/h/linesize when allocating dataAndreas Cadhalpun2016-11-24
| | | | | | | Rects with positive w/h/linesize but no data are invalid. Reviewed-by: Petri Hintukainen <phintuka@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Merge commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376'Clément Bœsch2016-06-21
|\ | | | | | | | | | | | | * commit 'b7e64fba7f37cc0399beae844f0a5dbef9219376': Reduce the scope of some variables Merged-by: Clément Bœsch <u@pkh.me>
| * Reduce the scope of some variablesDiego Biurrun2016-05-11
| | | | | | | | | | This avoids unused variable warnings after the next version bump. Also drop a trace level av_log() call that is in the way.
* | Merge commit '885a9d6087315a85d98f7e89656ef01dc7104c4c'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | | | | | * commit '885a9d6087315a85d98f7e89656ef01dc7104c4c': pgssub: Fix subpicture colorspace and range See 9779b6262471d553c1ed811ff7312564e39d8adf Merged-by: Clément Bœsch <u@pkh.me>
| * pgssub: Fix subpicture colorspace and rangeJan Ekström2016-05-10
| | | | | | | | | | | | | | | | | | Widen the values from limited to full range and use BT.709 where it should be used according to the video resolution: SD is BT.601, HD is BT.709 Default to BT.709 due to most observed HDMV content being HD.
| * pgssubdec: fix API compability layerPetri Hintukainen2015-11-26
| | | | | | | | | | | | | | Copy pointers to AVPicture after memory has been allocated. Fixes NULL pointers in AVPicture after a17a7661906ba295d67afd80ac0770422e1b02b3. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | pgssubdec: fix subpicture output colorspace and rangeJan Ekström2016-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functionality used before didn't widen the values from limited to full range. Additionally, now the decoder uses BT.709 where it should be used according to the video resolution. Default for not yet set colorimetry is BT.709 due to most observed HDMV content being HD. BT.709 coefficients were gathered from the first two parts of BT.709 to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2). They were additionally confirmed by manually calculating values. Fixes #4637
* | avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented ↵Michael Niedermayer2015-12-04
| | | | | | | | | | | | | | | | | | in type int Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/pgssubdec: Check dimensions for 0Michael Niedermayer2015-11-14
| | | | | | | | | | | | | | | | Fixes division by 0 Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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/pgssubdec: use AV_OPT_TYPE_BOOL for forced_subs_only optionClément Bœsch2015-09-12
| |
* | 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
| |
* | avcodec/pgssubdec: Use av_malloc*_array()Michael Niedermayer2015-01-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd98e6c5d5d80c1dfe0c30f2e73d41a3aea0b920d'Michael Niedermayer2014-08-01
|\| | | | | | | | | | | | | | | * commit 'd98e6c5d5d80c1dfe0c30f2e73d41a3aea0b920d': pgssubdec: Check RLE size before copying See: c0d68be555f5858703383040e04fcd6529777061 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pgssubdec: Check RLE size before copyingMichael Niedermayer2014-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the buffer size does not exceed the expected RLE size. Prevent an out of array bound write. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Bug-Id: CVE-2013-0852 Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/pgssubdec: Fix input ptsMichael Niedermayer2014-07-12
| | | | | | | | | | | | Fixes part of Ticket2516 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: remove unused variablesMichael Niedermayer2014-06-30
| | | | | | | | | | Found-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: Check input buffer size in parse_presentation_segment()Michael Niedermayer2014-06-30
| | | | | | | | | | | | Might fix overread, no testcase known though. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '253d0be6a1ecc343d29ff8e1df0ddf961ab9c772'Michael Niedermayer2014-06-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '253d0be6a1ecc343d29ff8e1df0ddf961ab9c772': pgssubdec: handle more complex PGS scenarios Conflicts: libavcodec/pgssubdec.c Some of this has been split out and commited in cleanly split patches immedeately before this merge Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pgssubdec: handle more complex PGS scenariosJohn Stebbins2014-06-30
| | | | | | | | | | | | | | | | | | Add ability to handle multiple palettes and objects simultaneously. Each simultaneous object is given its own AVSubtitleRect. Note that there can be up to 64 currently valid objects, but only 2 at any one time can be "presented". Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/pgssubdec: fix end display timeJohn Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: Bail out of decode_rle() if error and AV_EF_EXPLODE is setJohn Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: better error codesJohn Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: Pass AVSubtitleRect to decode_rle()John Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: split out flush_cache()John Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: do not fail when part of the packet is faulty unless ↵John Stebbins2014-06-30
| | | | | | | | | | | | AV_EF_EXPLODE is set Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: rename PICTURE_SEGMENTJohn Stebbins2014-06-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/pgssubdec: Use av_malloc(z)_array()Michael Niedermayer2014-05-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f9279ee74936b4990fc46287c27816ef828cc06c'Michael Niedermayer2014-03-22
|\| | | | | | | | | | | | | | | | | | | * commit 'f9279ee74936b4990fc46287c27816ef828cc06c': dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.h Conflicts: libavcodec/imgconvert.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Move ff_zigzag_direct and ff_crop_tab declarations to mathops.hDiego Biurrun2014-03-22
| |
* | 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.
* | avcodec/pgssubdec: Use av_fast_padded_malloc() for rle bufferMichael Niedermayer2014-01-15
| | | | | | | | | | | | | | Fixes: use of uninitialized memeory Fixes: msan_uninit-mem_7fa421d0e222_1765_Girl_With_The_Dragon_Tattoo_2_23_56.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '0f21d8b1b40848973558c737aebe800c46e93a3d'Michael Niedermayer2013-11-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0f21d8b1b40848973558c737aebe800c46e93a3d': pictordec: stop using deprecated avcodec_set_dimensions pgssubdec: stop using deprecated avcodec_set_dimensions pcx: stop using deprecated avcodec_set_dimensions mpegvideo_parser: stop using deprecated avcodec_set_dimensions Conflicts: libavcodec/pcx.c libavcodec/pgssubdec.c libavcodec/pictordec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pgssubdec: stop using deprecated avcodec_set_dimensionsAnton Khirnov2013-10-31
| |
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2': cosmetics: Group .name and .long_name together in codec/format declarations Conflicts: libavcodec/8svx.c libavcodec/alac.c libavcodec/cljr.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dpxenc.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/ffv1dec.c libavcodec/flacdec.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/g726.c libavcodec/gif.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopencore-amr.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/libvo-amrwbenc.c libavcodec/libvorbisenc.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/ljpegenc.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/proresdec_lgpl.c libavcodec/proresenc_kostya.c libavcodec/ra144enc.c libavcodec/rawdec.c libavcodec/rv10.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tta.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/wavpack.c libavcodec/xbmenc.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-03
| |
* | Fix wrong use of "an" in some comments.Thilo Borgmann2013-08-12
| |
* | pgssubdec: remove unused variablePaul B Mahol2012-11-28
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '1c5805521c3e406886341d752ebf38f8d41e1d13'Michael Niedermayer2012-11-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1c5805521c3e406886341d752ebf38f8d41e1d13': PGS subtitles: Set AVSubtitle pts value configure: Refactor CPPFLAGS settings for glibc/uclibc configure: add basic support for ARM AArch64 build: set -U__STRICT_ANSI__ for newlib Conflicts: configure libavcodec/pgssubdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * PGS subtitles: Set AVSubtitle pts valueJohn Stebbins2012-11-18
| | | | | | | | | | | | pts should be that of the packet containing the presentation segment. Signed-off-by: Diego Biurrun <diego@biurrun.de>