Commit Graph

148 Commits

Author SHA1 Message Date
Michael Niedermayer
0279e727e9 avcodec/cavsdec: Set ret on errors in decode_pic()
Fixes regression and fate failure on some machienes

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-17 13:17:18 +02:00
Michael Niedermayer
e7113704b2 avcodec/cavsdec: Check remaining bitstream in the main loop in decode_pic()
Fixes: Timeout (149sec ->1sec)
Fixes: 17311/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5679368642232320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-16 19:17:57 +02:00
Michael Niedermayer
37bc8e3249 avcodec/cavsdec: Limit the number of access units per packet to 2
Fixes: Timeout (122sec -> 13ms)
Fixes: 15978/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5148925004087296

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:16:18 +02:00
Michael Niedermayer
c1cee05656 avcodec/cavsdec: Propagate error codes inside decode_mb_i()
Fixes: Timeout
Fixes: 10702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5669940938407936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-04 20:21:24 +01:00
Michael Niedermayer
ae2eb04648 avcodec/cavsdec: Check alpha/beta offset
Fixes: Integer overflow
Fixes: 6183/clusterfuzz-testcase-minimized-6269224436629504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-02-22 00:29:27 +01:00
Michael Niedermayer
b9ce43625c avcodec/cavsdec: Check P/B frame mb decode which return error codes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-15 01:27:36 +02:00
Michael Niedermayer
426a322aa2 avcodec/cavsdec: Check I frame mb decode for errors
Fixes: timeout
Fixes: 2943/clusterfuzz-testcase-5430257156882432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-15 01:27:36 +02:00
Michael Niedermayer
58f8cd4ac5 avcodec/cavsdec: Fix runtime error: signed integer overflow: 59 + 2147483600 cannot be represented in type 'int'
Fixes: 1903/clusterfuzz-testcase-minimized-5359318167715840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-31 16:08:46 +02:00
Michael Niedermayer
5ac17f187a avcodec/cavsdec: Fix runtime error: signed integer overflow: 31 + 2147483640 cannot be represented in type 'int'
Fixes: 1506/clusterfuzz-testcase-minimized-5401272918212608

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-13 00:43:07 +02:00
Michael Niedermayer
279420b5a6 avcodec/cavsdec: Check sym_factor
Fixes: runtime error: signed integer overflow: 25984 * 130560 cannot be represented in type 'int'

Fixes: 1404/clusterfuzz-testcase-minimized-5000441286885376

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-08 12:30:09 +02:00
Michael Niedermayer
a0e5f7f363 avcodec/cavsdec: Fix undefined behavior from integer overflow
Fixes: 1335/clusterfuzz-testcase-minimized-5566961566089216

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-05 04:25:07 +02:00
James Almer
aec42ebc27 Merge commit 'f81be06cf614919d71ded29b8f595bef40123ad8'
* commit 'f81be06cf614919d71ded29b8f595bef40123ad8':
  cavs: Change type of stride parameters to ptrdiff_t

Merged-by: James Almer <jamrial@gmail.com>
2017-03-19 15:23:52 -03:00
Michael Niedermayer
493ad519dd avcodec/cavsdec: Clear MMX state after MB decode loop
The MMX state must be cleared between using MMX and using memory allocation
thats basically the only location between the 2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-22 13:46:05 +02:00
Andreas Cadhalpun
1966ea012f cavsdec: unref frame before referencing again
This fixes asserts (from commit 13aae8) in av_frame_ref and
av_frame_move_ref.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-10-21 19:41:15 +02:00
Diego Biurrun
f81be06cf6 cavs: Change type of stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
2016-08-26 11:48:15 +02:00
Hendrik Leppkes
52ce8b7b31 Merge commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b'
* commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b':
  mpegvideo: Drop mpegvideo.h where not needed

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-16 11:27:20 +02:00
Vittorio Giovara
e60a6e7545 mpegvideo: Drop mpegvideo.h where not needed
Add necessary headers in .c files.
2015-09-13 17:34:46 +02:00
Michael Niedermayer
444e9874a7 Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
* 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>
2015-07-27 22:50:18 +02:00
Vittorio Giovara
def97856de lavc: AV-prefix all codec capabilities
Express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Michael Niedermayer
f6b8b96607 avcodec/cavsdec: Use ff_set_dimensions()
Fixes CID1239111 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-14 18:12:30 +02:00
Michael Niedermayer
c5c06e392b avcodec/cavsdec: Check frame_rate_code
Fixes CID1239111 part1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-14 18:12:30 +02:00
Michael Niedermayer
139e1c8009 avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-14 17:56:16 +02:00
Michael Niedermayer
35e559ae32 avcodec/cavs: Check for av_malloc* failure in ff_cavs_init_top_lines()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 14:02:39 +01:00
Michael Niedermayer
cdbebae444 Merge commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa'
* commit '85dc006b1a829726dd5e3a9b0fcc6a1dbfe6dffa':
  lavc: fix bitshifts amount bigger than the type

Conflicts:
	libavcodec/internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-18 03:16:38 +01:00
Vittorio Giovara
85dc006b1a lavc: fix bitshifts amount bigger than the type
CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
2014-11-18 00:39:23 +01:00
Michael Niedermayer
17085a0251 Merge commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41'
* commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41':
  lavc: deprecate the use of AVCodecContext.time_base for decoding

Conflicts:
	libavcodec/avcodec.h
	libavcodec/h264.c
	libavcodec/mpegvideo_parser.c
	libavcodec/utils.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 15:49:31 +02:00
Anton Khirnov
7ea1b3472a lavc: deprecate the use of AVCodecContext.time_base for decoding
When decoding, this field holds the inverse of the framerate that can be
written in the headers for some codecs. Using a field called 'time_base'
for this is very misleading, as there are no timestamps associated with
it. Furthermore, this field is used for a very different purpose during
encoding.

Add a new field, called 'framerate', to replace the use of time_base for
decoding.
2014-10-15 06:37:43 +00:00
Michael Niedermayer
f9f8491ddf avcodec/cavs: make cavs_chroma_qp non static
The table is needed by multiple files

Reverts part of ef07ac1e12

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-28 19:08:39 +02:00
Yao Wang
e18b48c6fd avcodec/cavs: fix B_SUB_DIRECT col-MB is Intra MB case.
in this case current MB size is forced to 16x16 (AVS standard section 9.9.1)

Signed-off-by: Yao Wang <jiayaowang@gmail.com>
Fixes Ticket 1901

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 14:51:40 +02:00
Michael Niedermayer
2b05db4f81 Merge commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9'
* commit 'e74433a8e6fc00c8dbde293c97a3e45384c2c1d9':
  dsputil: Split clear_block*/fill_block* off into a separate context

Conflicts:
	configure
	libavcodec/asvdec.c
	libavcodec/dnxhddec.c
	libavcodec/dnxhdenc.c
	libavcodec/dsputil.h
	libavcodec/eamad.c
	libavcodec/intrax8.c
	libavcodec/mjpegdec.c
	libavcodec/ppc/dsputil_ppc.c
	libavcodec/vc1dec.c
	libavcodec/x86/dsputil_init.c
	libavcodec/x86/dsputil_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 04:54:38 +02:00
Diego Biurrun
e74433a8e6 dsputil: Split clear_block*/fill_block* off into a separate context 2014-06-18 14:07:23 -07:00
Michael Niedermayer
c932f12806 avcodec/cavsdec: simplify % 512 operations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 04:18:40 +02:00
Michael Niedermayer
61df0819d4 avcodec/cavsdec: fix low delay decoding
Fixes Ticket1095

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-17 02:30:28 +02:00
Michael Niedermayer
0accf24b15 cavsdec: fix qp fixed slice handling
Fixes Ticket3400

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 05:47:49 +02:00
Michael Niedermayer
a4f8a56495 Merge commit '4736d003fac30af4afd8390182f12f480ad78801'
* commit '4736d003fac30af4afd8390182f12f480ad78801':
  cavsdec: check ff_get_buffer() return value

Conflicts:
	libavcodec/cavsdec.c

See: eee8c94f50
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 15:52:44 +01:00
Anton Khirnov
4736d003fa cavsdec: check ff_get_buffer() return value
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:22:48 +01:00
Michael Niedermayer
be99054e77 avcodec/cavsdec: print error messages in case of errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 03:53:39 +01:00
Michael Niedermayer
bc1b828536 avcodec/cavsdec: use more specific error codes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 03:51:08 +01:00
Michael Niedermayer
9ca32b2060 avcodec/cavsdec: print warning if no frame has been decoded
Fixes ticket3128

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 02:17:15 +01:00
Michael Niedermayer
63f74cedc9 avcodec/cavsdec: reset stc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 02:16:59 +01:00
Michael Niedermayer
8d9f08ef32 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  cavs: Check for negative cbp

Conflicts:
	libavcodec/cavsdec.c

See: 9f06c1c61e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-14 10:18:36 +02:00
Michael Niedermayer
d794b7db14 Merge commit '1b20d0f581f01f2df601c9e68d0d321672d97af7'
* commit '1b20d0f581f01f2df601c9e68d0d321672d97af7':
  cavs: Return meaningful error values

Conflicts:
	libavcodec/cavsdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-14 02:10:43 +02:00
Luca Barbato
39185ec4fa cavs: Check for negative cbp
Sample-Id: 00000647-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-13 17:52:53 +02:00
Luca Barbato
1b20d0f581 cavs: Return meaningful error values 2013-10-13 17:52:53 +02:00
Michael Niedermayer
ee77140afa Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'
* 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>
2013-10-04 12:34:23 +02:00
Diego Biurrun
b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Michael Niedermayer
18e0dd05df Merge commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef'
* commit 'e90a6846c2c006fbebd00e1f2789f4a86fafacef':
  cavsdec: Make sure a sequence header has been decoded before decoding pictures

See: ec0965be36
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-16 13:04:00 +02:00
Martin Storsjö
e90a6846c2 cavsdec: Make sure a sequence header has been decoded before decoding pictures
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Michael Niedermayer
b19604cc4b Merge commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0'
* commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0':
  lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo

Conflicts:
	libavcodec/h264_parser.c
	libavcodec/internal.h
	libavcodec/mpeg12.c
	libavcodec/utils.c
	libavformat/mpegtsenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-26 13:44:09 +01:00
Martin Storsjö
f1e9398621 lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-26 09:50:02 +02:00