summaryrefslogtreecommitdiff
path: root/libavcodec/hnm4video.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Add const to decoder packet data pointersAndreas Rheinhardt2022-07-09
| | | | | | | The packets given to decoder need not be writable, so it is best to access them via const uint8_t*. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hnm4video: 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/hnm4video: Don't reimplement FFSWAP()Andreas Rheinhardt2020-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hnm4video: Don't return nonsense error messagesAndreas Rheinhardt2020-09-19
| | | | | | | | | | The HNM 4 video decoder's init function claimed that an allocation failed if the image dimensions are wrong. This is fixed in this commit: The dimensions are checked before the allocations are attempted. The check whether width * height is zero is redundant as av_image_check_size() already checks for this; it has been removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hnm4video: Cleanup generically on init failureAndreas Rheinhardt2020-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hnm4video: Optimize postprocess_current_frame()Michael Niedermayer2019-08-12
| | | | | | | | | Improves: Timeout (220sec -> 108sec) Improves: 15570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5085482213441536 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hnm4video: Forward errors of decode_interframe_v4()Michael Niedermayer2019-08-03
| | | | | | | | | Fixes: Timeout (108sec -> 160ms) Fixes: 15570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5085482213441536 Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/hnm4video: fix palette alphaMarton Balint2018-04-30
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * hnm4: change width/height to int to fix hypothetical integer overflowsMichael Niedermayer2014-11-25
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1135770 / CID 1135771
* | Merge commit '16158da9607f2f84232d3dd381406b2f2449ec74'Michael Niedermayer2014-11-25
|\| | | | | | | | | | | | | | | * commit '16158da9607f2f84232d3dd381406b2f2449ec74': hnm4: Use av_image_check_size See: e23b18321fb5cffb6e05d0b0ef00de9733f560da Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hnm4: Use av_image_check_sizeLuca Barbato2014-11-25
| | | | | | | | | | | | | | As done for all the other codecs not calling it indirectly. CC: libav-stable@libav.org Bug-Id: CID 1135770 / CID 1135771
* | avcodec/hnm4video: check offset before subtraction in decode_interframe_v4a()Michael Niedermayer2014-02-03
| | | | | | | | | | | | | | Fixes out of array read Fixes: signal_sigsegv_1326a09_1752_cov_245452111_GRTH301.HNS Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: change width/height to intMichael Niedermayer2013-12-10
| | | | | | | | | | | | | | Fixes hypothetical integer overflows Related to CID1135770 & CID1135771 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: allocate frame only when theres a coded frameMichael Niedermayer2013-11-23
| | | | | | | | | | | | | | | | | | | | | | Fixes memleak Fixes: asan_heap-oob_e76bdf_2224_MOTHOO.HNM This patch also removes the setting of palette_has_changed, which was set on a frame that was never returned Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: check writeoffset in decode_interframe_v4a()Michael Niedermayer2013-11-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: check dimensions for validityMichael Niedermayer2013-11-22
| | | | | | | | | | | | | | Fixes out of array read Fixes: asan_heap-oob_e76e18_1244_CASSE.HNM Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: fix missing newlines in error messagesMichael Niedermayer2013-11-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: fix write offset checks in decode_interframe_v4()Michael Niedermayer2013-11-22
| | | | | | | | | | | | | | Fixes: asan_heap-oob_e76a51_1244_CASSE.HNM Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: check offset in decode_interframe_v4() more completelyMichael Niedermayer2013-11-22
| | | | | | | | | | | | | | | | | | Fixes out of array reads Fixes: signal_sigsegv_e74c1e_1092_BROCIME.HNM Fixes: signal_sigsegv_e74e85_2620_PLAQUE0.HNM Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: check intraframe sizeMichael Niedermayer2013-11-22
| | | | | | | | | | | | Fixes hypothetical integer overflow with HNM4_CHUNK_ID_IZ Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: check that packetsize is at least 8Michael Niedermayer2013-11-22
| | | | | | | | | | | | | | | | Fixes integer overflow and assertion failure Fixes: signal_sigabrt_7ffff7126425_1243_CASSE.HNM Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/hnm4video: remove redundant log messagePaul B Mahol2013-11-07
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '9af7a8523a6bb517834ebed36093bdab11a8b38e'Michael Niedermayer2013-11-01
|/ | | | | | | | | | | | | | | | | | * commit '9af7a8523a6bb517834ebed36093bdab11a8b38e': HNM4/HNM4A demuxer & video decoder Conflicts: Changelog doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/version.h libavformat/Makefile libavformat/allformats.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* HNM4/HNM4A demuxer & video decoderDavid Kment2013-10-31
Signed-off-by: Diego Biurrun <diego@biurrun.de>