1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-05 07:48:07 +02:00
Commit Graph

35 Commits

Author SHA1 Message Date
Andreas Rheinhardt
1ea3650823 Replace all occurences of av_mallocz_array() by av_calloc()
They do the same.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-20 01:03:52 +02:00
Andreas Rheinhardt
3dacb09f10 avcodec/ivi: Fix indentation
Also improve readability by keeping a pointer to the IVIBandDesc that is
currently freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-26 21:15:33 +02:00
Andreas Rheinhardt
14be39e44a avcodec/ivi: Make initializing VLCs thread-safe
This automatically makes indeo4/5 init-threadsafe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-08 17:51:48 +01:00
Andreas Rheinhardt
d7a503ecf9 avcodec/ivi: Avoid reversing BE VLC codes for LE bitstream reader
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-10-12 22:38:40 +02:00
Andreas Rheinhardt
e411a3af11 avcodec/ivi: Fix segfault on allocation error
If allocating the tiles array for indeo 4/5 fails, the context is in an
inconsistent state, because the counter for the number of tiles is > 0.
This will lead to a segfault when freeing the tiles' substructures.
Fix this by setting the number of tiles to zero if the allocation was
unsuccessful.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-15 19:25:26 +02:00
Michael Niedermayer
1d633e6a0a avcodec/ivi: Clear got_p_frame before decoding a new frame using it
Fixes: assertion failure
Fixes: 21666/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5706468994318336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-21 09:31:08 +02:00
Andreas Rheinhardt
cc2a9509ce libavcodec, libpostproc: Remove outcommented START/STOP_TIMER
as well as includes of libavutil/timer.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-14 18:24:04 +01:00
Michael Niedermayer
a15d904ad7 avcodec: Replace get_bits_long() by get_bits() where possible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-31 18:43:50 +01:00
Michael Niedermayer
79d5d79f38 avcodec: Replace show_bits_long() by show_bits() where possible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-31 18:43:50 +01:00
Michael Niedermayer
15a65c13e1 avcodec/ivi: Allocate bufs later
Fixes: Timeout (24sec->2sec)
Fixes: 15951/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5095433266790400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-29 15:57:54 +02:00
Michael Niedermayer
a7e02cf3ad avcodec/ivi: Ask for samples with odd tiles
Fixes: Assertion failure
Fixes: 15422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5676625481433088

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-17 23:18:50 +02:00
Michael Niedermayer
110dce9633 avcodec/ivi: Move buffer/block end check to caller of ivi_dc_transform()
Fixes: assertion failure
Fixes: 14078/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5760571284127744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-19 21:06:09 +02:00
Michael Niedermayer
4eec008259 avcodec/ivi: Reduce dereferencing structs in inner loop of ivi_process_empty_tile()
This speeds the code up by about 15%
Testcase: 13779/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5699589711069184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-31 23:23:52 +02:00
Michael Niedermayer
4bf9561d63 avcodec/ivi: Mark band parameter as const
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-31 23:23:52 +02:00
Michael Niedermayer
111e9b0929 avcodec/ivi: fix indention for previous commit 2019-03-31 23:23:52 +02:00
Michael Niedermayer
c163e62db5 avcodec/ivi: Factor ref_mb check out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-31 23:23:52 +02:00
Michael Niedermayer
80cce5998c avcodec/ivi: Avoid mbs memleak
Fixes: 11696/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5740319635668992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-23 20:24:47 +01:00
Michael Niedermayer
bf97d11b08 avcodec/ivi: Factor width dereference out of the loops in ivi_output_plane()
396078 -> 268468 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:48:15 +02:00
Michael Niedermayer
82920bf494 avcodec/ivi: Only clip samples when needed in ivi_output_plane()
435740 -> 396078 dezicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-12 21:48:11 +02:00
Michael Niedermayer
a824685140 avcodec/ivi: Use av_image_check_size2()
Fixes OOM
Fixes: 1514/clusterfuzz-testcase-minimized-6437666243477504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-07-12 20:36:13 +02:00
Michael Niedermayer
12dea8a5a1 avcodec/ivi: Free custom blk_vlc
Fixes memleak
Fixes: 1351/clusterfuzz-testcase-minimized-5861971645693952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-06 00:33:19 +02:00
Clément Bœsch
bb3ad401fc Merge commit '746c56b7730ce09397d3a8354acc131285e9d829'
* commit '746c56b7730ce09397d3a8354acc131285e9d829':
  indeo: Change type of array pitch parameters to ptrdiff_t

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-20 09:07:57 +01:00
Paul B Mahol
c331be21c4 avcodec/ivi: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:36:23 +01:00
Diego Biurrun
746c56b773 indeo: Change type of array pitch parameters to ptrdiff_t
ptrdiff_t is the correct type for array pitches and similar.
2016-09-04 11:57:15 +02:00
Clément Bœsch
ae753dbd0d Merge commit 'b668662939de3a02454cfc9ba3e6d10b87527a40'
* commit 'b668662939de3a02454cfc9ba3e6d10b87527a40':
  get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes

The merge commit also includes changes for libavcodec/interplayacm.c and
libavcodec/truemotion2rt.c

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-29 11:35:10 +02:00
Diego Biurrun
b668662939 get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes
This avoids the danger that get_bits.h might get indirectly #included before
BITSTREAM_READER_LE is defined.

Also sort headers into canonical order where appropriate.
2016-06-07 13:09:57 +02:00
Derek Buitenhuis
1117d6f4b1 Merge commit '6202e2fede75df92cbc374a3f7d6893d0c5ac721'
* commit '6202e2fede75df92cbc374a3f7d6893d0c5ac721':
  indeo4: Rework stream analysis report

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 18:51:58 +01:00
Vittorio Giovara
6202e2fede indeo4: Rework stream analysis report
* Change log level from error to debug
* Print report after the first decoded frame, not at the end of decoding
* Drop macro guard and use a context variable instead

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-03-22 16:03:52 -04:00
Hendrik Leppkes
95a2b883e3 Merge commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1'
* commit '69a68593ce5684409c3c4dd9a901bfd8b16925b1':
  Remove stray line breaks from avpriv_{report_missing_feature|request_samples}

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-01-02 13:20:13 +01:00
Diego Biurrun
69a68593ce Remove stray line breaks from avpriv_{report_missing_feature|request_samples} 2015-12-26 10:28:03 +01:00
Michael Niedermayer
df91aa034b avcodec/ivi: Check image dimensions
Fixes integer overflow
Fixes: 1e32c6c591d940337c20b197ec1c4d3d/asan_heap-oob_4a52e5_8946_0bb0d9e863def56005e49f1d89bdc94d.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14 02:37:12 +01:00
Michael Niedermayer
8f7b022c8c Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
* 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>
2015-04-20 04:10:10 +02:00
Vittorio Giovara
6a85dfc830 lavc: Replace av_dlog and tprintf with internal macros 2015-04-19 12:41:59 +01:00
Michael Niedermayer
98263d7515 Merge commit '23944d29a22a2cd602753b3705f73011c3bf0b18'
* commit '23944d29a22a2cd602753b3705f73011c3bf0b18':
  indeo: Give Indeo4/5 shared code a more consistent name

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-30 20:39:08 +02:00
Diego Biurrun
23944d29a2 indeo: Give Indeo4/5 shared code a more consistent name 2015-03-30 17:49:05 +02:00