Commit Graph

38153 Commits

Author SHA1 Message Date
Michael Niedermayer
c535436cbe avcodec/mlpdec: Fix runtime error: left shift of negative value -22
Fixes: 1355/clusterfuzz-testcase-minimized-6662205472768000

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 12:08:14 +02:00
Michael Niedermayer
e813df4fa3 avcodec: Avoid splitting side data repeatedly
Fixes Timeout
Fixes: 508/clusterfuzz-testcase-6245747678773248

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 03:54:17 +02:00
Michael Niedermayer
523205ce1e avcodec/snowdec: Check qbias
Fixes: signed integer overflow: -1094995529 * 131 cannot be represented in type 'int'
Fixes: 1353/clusterfuzz-testcase-minimized-5208180449607680

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 02:11:34 +02:00
James Almer
859cc5c8e6 avcodec/hevc_parser: cosmetics
Reduces differences with libav slightly.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 20:10:17 -03:00
James Almer
214f4133c4 avcodec/hevc_parser: move hevc_find_frame_end() down in the file
Reduces differences with libav.
2017-05-05 20:10:17 -03: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
Michael Niedermayer
a8ad83b793 avcodec/aacsbr_template: Do not leave bs_num_env invalid
Fixes out of array read
Fixes: 1349/clusterfuzz-testcase-minimized-5370707196248064

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
Michael Niedermayer
a234b5ade3 avcodec/mdec: Fix signed integer overflow: 28835400 * 83 cannot be represented in type 'int'
Fixes: 1346/clusterfuzz-testcase-minimized-5776732600664064

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
James Almer
6a72578cc2 avcodec/hevc_parse: decode SEI message NALUs in extradata
They may be available in hvcc style extradata.

Based on a patch by Hendrik Leppkes.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:38 -03:00
James Almer
bf1e3be5a3 avcodec/hevc_parser: move slice header parsing to its own function
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:37 -03:00
James Almer
1c088632e9 avcodec/hevc_parser: remove HEVCContext usage
This gets rid of the duplicate, limited parser.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:37 -03:00
James Almer
ceb0859066 avcodec/hevc_parser: use ff_h2645_packet_split() to parse NAL units
This simplifies the code considerably.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:36 -03:00
James Almer
4aaace8b25 avcodec/hevcdec: move SliceHeader struct definition to hevc_ps
This is in preparation for a following patch.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:36 -03:00
James Almer
1d53b8e907 avcodec/hevcdec: remove HEVCContext usage from ff_hevc_compute_poc()
Move it to hevc_ps as well. This is in preparation for a following patch.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:36 -03:00
James Almer
a687fb9970 avcodec/hevcdec: move SEI message parsing into a separate header
It doesn't depend on hevcdec anymore.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:35 -03:00
James Almer
c4b08c8a4e avcodec/hevcdec: remove HEVCContext usage from hevc_sei
Based on the H264 SEI implementation.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:35 -03:00
Michael Niedermayer
f52fbf4f3e avcodec/dfa: Fix off by 1 error
Fixes out of array access
Fixes: 1345/clusterfuzz-testcase-minimized-6062963045695488

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 20:42:55 +02:00
Michael Niedermayer
0953736b7e avcodec/nellymoser: Fix multiple left shift of negative value -8591
Fixes: 1342/clusterfuzz-testcase-minimized-5490842129137664

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 19:29:32 +02:00
Michael Niedermayer
1002932a3b avcodec/cdxl: Fix signed integer overflow: 14243456 * 164 cannot be represented in type 'int'
Fixes: 1341/clusterfuzz-testcase-minimized-5441502618583040

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 19:26:36 +02:00
Michael Niedermayer
f55df62998 avcodec/g722: Fix multiple runtime error: left shift of negative value -1
Fixes: 1340/clusterfuzz-testcase-minimized-4669892148068352

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 18:33:38 +02:00
Michael Niedermayer
38152d9368 avcodec/dss_sp: Fix multiple left shift of negative value -466
Fixes: 1339/clusterfuzz-testcase-minimized-4614671485108224

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 18:33:38 +02:00
Michael Niedermayer
9fac508ca4 avcodec/wnv1: Fix runtime error: left shift of negative value -1
Fixes: 1338/clusterfuzz-testcase-minimized-6485546354343936

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 18:33:38 +02:00
Clément Bœsch
3c085c1ba5 Merge commit 'b68e353136db6f963212c457281d9716516cdc59'
* commit 'b68e353136db6f963212c457281d9716516cdc59':
  qsvdec: do not sync PIX_FMT_QSV surfaces

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 14:11:51 +02:00
Michael Niedermayer
527f89e059 avcodec/aacps: Fix undefined behavior
Fixes: 1337/clusterfuzz-testcase-minimized-5212314171080704

Fixes the existence of a potentially invalid pointer intermediate

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 13:36:52 +02:00
Michael Niedermayer
1f5b6c7e1e avcodec/pixlet: Fix shift exponent 4294967268 is too large for 32-bit type 'int'
Fixes: 1336/clusterfuzz-testcase-minimized-4761381930795008

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 13:36:52 +02:00
Michael Niedermayer
ce551a3925 avcodec/tiertexseqv: set the fixed dimenasions, do not depend on the demuxer doing so
Fixes: out of array access
Fixes: 1348/clusterfuzz-testcase-minimized-6195673642827776

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 13:36:52 +02:00
Clément Bœsch
20e72faef6 Merge commit 'f1af37b51033ad90e56a8d7dfcc366f2bd9d2fed'
* commit 'f1af37b51033ad90e56a8d7dfcc366f2bd9d2fed':
  h264dec: make ff_h264_decode_init() static

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 11:33:39 +02:00
Clément Bœsch
d168fe14e9 Merge commit '0ac2d86c4758e1419934905b6c092910296aa16a'
* commit '0ac2d86c4758e1419934905b6c092910296aa16a':
  dxva2: Factorize DXVA context validity test into a single macro

This commit is (mostly) a noop, see 77742c75c5

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 10:56:21 +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
Michael Niedermayer
ce7098b8f2 avcodec/dvdsubdec: Fix runtime error: left shift of 242 by 24 places cannot be represented in type 'int'
Fixes: 1080/clusterfuzz-testcase-5353236754071552

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
8acd73e348 avcodec/vorbisdec: add missing comma
Should fix compilation failures after 191b2d4fc9.

Found-by: philipl
2017-05-04 21:44:58 -03:00
James Almer
fb496921e8 Merge commit '53618054b64ce4dab459d23a7efebe9d5afc4855'
* commit '53618054b64ce4dab459d23a7efebe9d5afc4855':
  parser: Add missing #include for printing ISO C99 conversion specifiers

Merged-by: James Almer <jamrial@gmail.com>
2017-05-04 21:41:43 -03:00
James Almer
191b2d4fc9 Merge commit '0b77a5933635293508e7289e7cf191ed166cf070'
* commit '0b77a5933635293508e7289e7cf191ed166cf070':
  Use correct printf conversion specifiers for POSIX integer types

See 549045254c

Merged-by: James Almer <jamrial@gmail.com>
2017-05-04 21:21:16 -03:00
James Almer
6fdd35a312 Merge commit '92db5083077a8b0f8e1050507671b456fd155125'
* commit '92db5083077a8b0f8e1050507671b456fd155125':
  build: Generate pkg-config files from Make and not from configure
  build: Store library version numbers in .version files

Includes cherry-picked commits 8a34f36593 and
ee164727dd to fix issues.

Changes were also made to retain support for raise_major and build_suffix.

Reviewed-by: ubitux
Merged-by: James Almer <jamrial@gmail.com>
2017-05-04 19:59:30 -03:00
wm4
c0f17a905f cuvid: support AVCodecContext.hw_device_ctx API
This is a newer API that is intended for decoders like the cuvid
wrapper. Until now, the wrapper required to set an awkward
"incomplete" hw_frames_ctx to set the device. Now the device
can be set directly, and the user can get AV_PIX_FMT_CUDA output
for a specific device simply by setting hw_device_ctx.

This still does a dummy ff_get_format() call at init time, and should
be fully backward compatible.
2017-05-05 00:17:41 +02:00
Michael Niedermayer
a78ae465fd avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot be represented in type 'int'
Fixes: 943/clusterfuzz-testcase-5114865297391616

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-04 20:42:54 +02:00
Michael Niedermayer
fc4f88375b avcodec/wavpack: Fix invalid shift and integer overflow
Fixes: 940/clusterfuzz-testcase-5200378381467648

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-04 20:32:11 +02:00
Michael Niedermayer
d2657d225c avcodec/flicvideo: Check for chunk overread
Fixes integer overflow
Fixes: 1292/clusterfuzz-testcase-minimized-5795512143839232

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 19:52:23 +02:00
Michael Niedermayer
c1c3a14073 libavcodec/mpeg4videodec: Convert sprite_offset to 64bit
This avoids intermediates from overflowing (the final values are checked)
Fixes: runtime error: signed integer overflow: -167712 + -2147352576 cannot be represented in type 'int'

Fixes: 1298/clusterfuzz-testcase-minimized-5955580877340672

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-04 19:49:45 +02:00
Michael Niedermayer
a0296fc056 avcodec/pngdec: Use ff_set_dimensions()
Fixes OOM
Fixes: 1314/clusterfuzz-testcase-minimized-4621997222920192

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-04 18:41:30 +02:00
Michael Niedermayer
cabfed6895 avcodec/msvideo1: Check buffer size before re-getting the frame
Fixes timeout
Fixes: 1306/clusterfuzz-testcase-minimized-6152296217968640

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-04 17:15:43 +02:00
Clément Bœsch
3f17751eeb Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'
* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-03 16:49:12 +02:00
Michael Niedermayer
48b3117844 avcodec/svq3: Reject dx/dy beyond 16bit
The code does use 16bit sized arrays later so larger deltas would not work

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-03 11:57:34 +02:00
Michael Niedermayer
382b4fc9b5 avcodec/svq3: Increase offsets to prevent integer overflows
Fixes: 1280/clusterfuzz-testcase-minimized-6102353767825408

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-03 11:57:34 +02:00
Carl Eugen Hoyos
a75ef1506a lavc/jpeg2000dec: Fix jp2 inner atom size used for overread checks. 2017-05-03 03:45:33 +02:00
James Almer
b3570f0389 avcodec/decode: also check for FF_CODEC_CAP_SETS_PKT_DTS in audio decoders
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-02 20:47:33 -03:00
Muhammad Faiz
9b4648a2cd avcodec/decode: do not treat discarded frames as eof when draining
Fix fate failures:
    make fate-mov THREADS=32

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-05-03 01:31:48 +07:00
James Almer
0a6ca7aa0a avcodec/internal: update FF_CODEC_CAP_SETS_PKT_DTS doxy
The code it refers to was moved to decode.c in 00fb745a10
2017-05-01 20:38:34 -03:00
Carl Eugen Hoyos
f4c133c708 lavc/mips/iirfilter_mips: Include config.h.
Fixes the following warning:
libavcodec/mips/iirfilter_mips.c:57:5: warning: "HAVE_INLINE_ASM" is not defined
2017-05-01 23:46:28 +02:00
Carl Eugen Hoyos
a88b0b0ba7 lavc/mips/hevc_idct_msa: Add missing const qualifier.
Fixes many warnings:
initialization discards 'const' qualifier from pointer target type
2017-05-01 23:44:21 +02:00