Commit Graph

562 Commits

Author SHA1 Message Date
Michael Niedermayer
cf7f35ace5 tools/target_dec_fuzzer: Adjust threshold for MSZH
Fixes: Timeout (250sec -> 6sec)
Fixes: 17627/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSZH_fuzzer-5643017129558016

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
ec9d48da19 tools/target_dec_fuzzer: Also fuzz keyframe & disposal flags
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-15 17:09:22 +02:00
Michael Niedermayer
cc50d113c8 tools/target_dec_fuzzer: Also fuzz codec_tag
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-14 21:16:00 +02:00
Michael Niedermayer
2d3ccfa863 tools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-14 21:16:00 +02:00
Michael Niedermayer
0c07eb5205 tools/target_dec_fuzzer: Also fuzz block_align
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-10-14 21:16:00 +02:00
Michael Niedermayer
47b0d0812e tools/target_dec_fuzzer: Adjust VP7 threshold
Fixes: Timeout (110sec -> 10sec)
Fixes: 17705/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP7_fuzzer-5765834135306240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-29 22:18:58 +02:00
Michael Niedermayer
ec4ad6fb9e tools/target_dec_fuzzer: Print samples decoded like pixels
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
db614008bc tools/target_dec_fuzzer: Check number of all samples decoded too, like max pixels
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-26 21:02:34 +02:00
Michael Niedermayer
68c80dc312 tools/target_dec_fuzzer: Set max_samples
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:18:37 +02:00
Michael Niedermayer
59163731e9 tools/target_dec_fuzzer: consider potential padding/edge in pixel threshold
Fixes: Timeout (73sec ->30ms)
Fixes: 16921/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5689384594046976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-24 17:53:39 +02:00
Michael Niedermayer
5fe6a9db15 tools/target_dec_fuzzer: Adjust threshold for MSS2
The decoder is slow

Fixes: Timeout (94sec -> 7sec)
Fixes: 16417/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSS2_fuzzer-5711668050395136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-24 17:53:39 +02:00
James Zern
ba24b24aab tools/patcheck: remove gcc-2.95 compat check
this conflicts with the current contributing guidance:
http://ffmpeg.org/developer.html#Contributing
FFmpeg is programmed in the ISO C90 language with a few additional
features from ISO C99, namely:
...
for loops with variable definition (‘for (int i = 0; i < 8; i++)’);

Signed-off-by: James Zern <jzern@google.com>
2019-09-21 12:57:04 -07:00
Michael Niedermayer
87a7fc692d tools/target_dec_fuzzer: fuzz channels and sample_rate too
This should increase coverage over more audio decoders.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-20 23:26:34 +02:00
Guo, Yejun
b2683c66b2 libavfilter/dnn: add layer maximum for native mode.
The reason to add this layer is that it is used by srcnn in vf_sr.
This layer is currently ignored in native mode. After this patch,
we can add multiple outputs support for native mode.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-09-20 10:57:18 -03:00
Michael Niedermayer
65589ad553 tools/target_dec_fuzzer: Adjust threshold for binkvideo
Fixes: Timeout (89sec -> 7sec)
Fixes: 17035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINK_fuzzer-5737222422134784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-17 14:45:08 +02:00
Michael Niedermayer
305f6dbb06 tools/target_dec_fuzzer: increase snows threshold
snow allows creating large output from tiny input, like other
wavelet codecs

Fixes: Timeout (82sec -> 1.5sec)
Fixes: 9520/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-6286612576075776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-16 00:53:18 +02:00
Michael Niedermayer
9fd62b84d5 tools/target_dec_fuzzer: Adjust motionpixels threshold
Fixes: Timeout (151sec -> 173ms)
Fixes: 16053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5647069169057792
Fixes: 16053/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOTIONPIXELS_fuzzer-5108957126852608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-16 00:04:18 +02:00
Michael Niedermayer
9d1e98afee tools/target_dec_fuzzer: Adjust threshold for LSCR
Fixes: Timeout (12sec -> 3sec)
Fixes: 15327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5702887719567360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-09 23:04:53 +02:00
Guo, Yejun
022f50d3fe libavfilter/dnn: add header into native model file
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-09-04 11:13:21 -03:00
Michael Niedermayer
5a3dee65d4 tools/target_dec_fuzzer: adjust pixel threshold for TRUEMOTION2, as it allows coding gigantic images on tiny input
Fixes: Timeout (137sec -> 6sec)
Fixes: 16090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5674245178261504

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-31 18:34:05 +02:00
Michael Niedermayer
a370582ba9 tools/target_dec_fuzzer: Init parsepkt
Fixes: memory corruption
Fixes: 16702/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-5768418552184832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-31 17:33:56 +02:00
Guo, Yejun
83e0b71f66 dnn: export operand info in python script and load in c code
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-08-30 11:41:30 -03:00
Guo, Yejun
2d5e39c13e dnn: change .model file format to put layer number at the end of file
currently, the layer number is at the beginning of the .model file,
so we have to scan twice in python script, the first scan to get the
layer number. Only one scan needed after put the layer number at the
end of .model file.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-08-30 11:41:30 -03:00
Michael Niedermayer
ba823394f6 tools/target_dec_fuzzer: Adjust maxpixels for indeo4
Fixes: Timeout (131sec -> 4sec)
Fixes: 15581/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5651105515569152

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
96efaa9a1a tools/target_dec_fuzzer: Adjust GDV pixel threshold down by a factor of 2
Fixes: Timeout (7sec -> 1sec)
Fixes: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072

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
738ff94f7c tools/target_dec_fuzzer: adjust pixel threshold for SANM, as it allows coding gigantic images on tiny input
Fixes: Timeout (13sec ->1sec)
Fixes: 16122/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5724944247291904

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
02a44ed0c8 tools/target_dec_fuzzer: Increase maxpixels threshold for dirac
wavelets allow significant size expansion and they are also not
very fast.

Fixes: Timeout
Fixes: 16480/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5659892689403904 (108sec -> 17ms)
Fixes: 16480/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5749422717140992 (big ->15sec)

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>
2019-08-26 10:36:40 +02:00
Michael Niedermayer
5af613cc48 tools/target_dec_fuzzer: Do not corrupt the packet size return
Fixes: Timeout (infinite)
Fixes: 16732/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-5642166377906176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-26 10:36:40 +02:00
James Almer
92c32b0f0c tools/target_dec_fuzzer: use refcounted packets
Should reduce allocations and data copying.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-23 11:08:36 -03:00
Michael Niedermayer
ac77c5492f tools/target_dec_fuzzer: Do not increase max_pixels
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 14:38:42 +02:00
Guo, Yejun
ddd92ba2c6 convert_from_tensorflow.py: support conv2d with dilation
conv2d with dilation > 1 generates tens of nodes in graph, it is not
easy to parse each node one by one, so we do special tricks to parse
the conv2d layer.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-08-15 14:58:19 -03:00
Guo, Yejun
2c01434d60 convert_from_tensorflow.py: add option to dump graph for visualization in tensorboard
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-08-15 14:58:19 -03:00
Michael Niedermayer
df7e79a5c3 tools/target_dec_fuzzer: adjust pixel threshold for MSRLE, as it allows coding gigantic images on tiny input
Fixes: Timeout (12sec ->2sec)
Fixes: 16125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSRLE_fuzzer-5650846364205056

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>
2019-08-15 01:26:21 +02:00
Michael Niedermayer
1e2e47e348 tools/target_dec_fuzzer: Print max_pixels and iterations at the end
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-13 16:48:38 +02:00
Nicolas George
2b4c1a0f3c tools/aviocat: add verbose mode.
For now: print the input size as detected by AVSEEK_SIZE.
2019-08-13 15:38:57 +02:00
Michael Niedermayer
faa9cd312f tools/target_dec_fuzzer: Add missing breaks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-12 08:51:09 +02:00
Michael Niedermayer
9e0e9a5f36 tools/target_dec_fuzzer: Limit number off all pixels decoded
This should reduces the number of uninteresting timeouts encountered

A single threshold for all codecs did not work

Fixes: 13979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QTRLE_fuzzer-5629872380051456 (14sec -> 4sec)
Fixes: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072 (179sec -> 7sec)
Fixes: 16296/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5756304521428992 (108sec -> 9sec)
Fixes: 15620/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GIF_fuzzer-5657214435459072 (26sec -> 26ms)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-12 08:45:07 +02:00
Andriy Gelman
90e965be6d tools/zmqsend: Avoid mem copy past the end of input buffer
This patch avoids a read past the end of the input buffer in memcpy since the size
of the received zmq message is recv_buf_size - 1.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-09 23:18:58 +02:00
Michael Niedermayer
42a2edcc1d tools/target_dec_fuzzer: fix memleak of extradata
Fixes: memleak
Fixes: 15535/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5692162424963072

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-31 20:35:07 +02:00
Guo, Yejun
ccbab41039 dnn: convert tf.pad to native model in python script, and load/execute it in the c code.
since tf.pad is enabled, the conv2d(valid) changes back to its original behavior.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
2019-07-29 12:34:19 -03:00
Michael Niedermayer
508ce5839e tools/target_dec_fuzzer: Free parser in case of avcodec_open2() failure
Fixes: memleak
Fixes: part of 15529/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-5140143700180992

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-21 12:33:35 +02:00
Michael Niedermayer
ed4c6ce750 tools/target_dem_fuzzer: ignore avformat_find_stream_info() failure
Such a failure should not be fatal and its worth testing this path too

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-19 11:27:55 +02:00
Michael Niedermayer
9b5249a441 tools/target_dec_fuzzer: Remove redundant av_free()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-13 14:42:57 +02:00
Guo, Yejun
50e194e6e1 tools/python: add script to convert TensorFlow model (.pb) to native model (.model)
For example, given TensorFlow model file espcn.pb,
to generate native model file espcn.model, just run:
python convert.py espcn.pb

In current implementation, the native model file is generated for
specific dnn network with hard-code python scripts maintained out of ffmpeg.
For example, srcnn network used by vf_sr is generated with
https://github.com/HighVoltageRocknRoll/sr/blob/master/generate_header_and_model.py#L85

In this patch, the script is designed as a general solution which
converts general TensorFlow model .pb file into .model file. The script
now has some tricky to be compatible with current implemention, will
be refined step by step.

The script is also added into ffmpeg source tree. It is expected there
will be many more patches and community needs the ownership of it.

Another technical direction is to do the conversion in c/c++ code within
ffmpeg source tree. While .pb file is organized with protocol buffers,
it is not easy to do such work with tiny c/c++ code, see more discussion
at http://ffmpeg.org/pipermail/ffmpeg-devel/2019-May/244496.html. So,
choose the python script.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2019-07-01 10:23:47 -03:00
Michael Niedermayer
6f2625aafc tools/target_dec_fuzzer: Also fuzz extradata
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-14 21:36:39 +02:00
Michael Niedermayer
0a2b768d3e tools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames
This should reduce the amount of timeout issues overall

Fixes: Timeout (34->10sec)
Fixes: 14682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5728608414334976

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-05 13:19:59 +02:00
Michael Niedermayer
710b7ec071 tools: Add fuzzer for demuxers
This is based on target_dec_fuzzer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-31 22:44:30 +02:00
Jun Zhao
a6cd3ad21f tools/crypto_bench: update the comment about build command
commit cd62f9d557 missing the comment about build

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-09 17:03:30 +08:00
Jun Zhao
153a6a67a9 tools/crypto_bench: check malloc fail before using it
Need to check malloc fail before using it, so adjust the location
in the code.

Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-09 16:59:55 +08:00
Michael Niedermayer
21b90435d6 tools/target_dec_fate.list: add issues 4000 to 6000
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-20 21:12:45 +01:00
James Almer
06476249cd Merge commit '7e5bde93a1e7641e1622814dafac0be3f413d79b'
* commit '7e5bde93a1e7641e1622814dafac0be3f413d79b':
  build: Rename OBJDIRS variable to OUTDIRS

Merged-by: James Almer <jamrial@gmail.com>
2019-03-10 19:31:13 -03:00
Michael Niedermayer
3b23eb283a tools/target_dec_fate.list: Add testcases for #2000 to #4000
Testcases which return 403 currently are commented out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-01 23:25:08 +01:00
Michael Niedermayer
b7140a4db5 tools/target_dec_fate.sh: Add support for lines that are comments
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-01 23:25:08 +01:00
Diego Biurrun
7e5bde93a1 build: Rename OBJDIRS variable to OUTDIRS
These directories are not just for object files.
2019-02-16 13:09:35 +01:00
Michael Niedermayer
dfae0e295a tools/target_dec_fate.list: Extend selftests upto issue 2000
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-02-09 14:40:50 +01:00
Michael Niedermayer
b860f2218a tools/target_dec_fate.list: add entries upto 1214
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-28 01:09:38 +01:00
Michael Niedermayer
5faa1b8b5a tools/target_dec_fate: Add entries from around issue 500 to 700
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-04 20:32:03 +01:00
Michael Niedermayer
fccba32b4c tools: add target_dec_fate.sh
Script to download and test ossfuzz testcases
This also includes a list of such testcases.
I intend to subsequently fill this list with the cases we have fixed in the past

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-12-29 00:52:34 +01:00
Carl Eugen Hoyos
1a6cca1989 configure: Make sure libpostproc can be found if -rpath-link doesn't work.
Solaris ld takes "-rpath-link=libpostproc" as indication to search in "-link=libpostproc".
2018-12-28 00:22:13 +01:00
Carl Eugen Hoyos
1ffd63a445 tools/qt-faststart: Allow free atoms after moov atom. 2018-08-01 00:49:54 +02:00
Michael Niedermayer
5c0fd9df87 tools/target_dec_fuzzer: set parser codec id to avoid assertion failure
Fixes: 9211/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GSM_fuzzer-5680396581732352
Fixes: assertion failure

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-07 12:09:34 +02:00
Michael Niedermayer
9f0077cc03 tools/target_dec_fuzzer: Fix parser_avctx memleak on error path
Fixes: oss-fuzz issue 9195

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-30 16:13:48 +02:00
Michael Niedermayer
310a49f71d tools/target_dec_fuzzer: Also optionally fuzz with a parser
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-28 21:35:01 +02:00
erankor
3dc5aa36fb qt-faststart - print errors to stderr
instead of stdout

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-15 21:42:18 +02:00
erankor
dc16c9dd90 qt-faststart - stco offset bug fix
when the last offsets in the stco atom are close to 4GB, the addition of
the moov atom size can overflow, causing corruption near the end of the
mp4 file.
this patch upgrades all stco atoms to co64 when such an edge case is
detected. in order to accomplish this, the implementation was changed to
walk the atom tree, instead of searching for the strings 'stco'/'co64'.
this was required since when an stco atom is changed to co64, its size
changes, and the sizes of all containing atoms (moov, trak, etc.) have
to be updated as well.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-13 21:55:19 +02:00
erankor
ee09ffbfd2 qt-faststart: add validation on ftyp atom size
avoid trying to allocate an unreasonably sized buffer on corrupt files

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-06-13 21:55:19 +02:00
James Almer
e3734aa6a3 tools/crypto_bench: add missing RC4 implementation from tomcrypt
Signed-off-by: James Almer <jamrial@gmail.com>
2018-05-30 14:45:26 -03:00
James Almer
5420c8f76e tools/crypto_bench: add missing RC4 implementation from gcrypt
Signed-off-by: James Almer <jamrial@gmail.com>
2018-05-30 14:08:44 -03:00
James Almer
cd62f9d557 tools/crypto_bench: add support for mbedcrypto
Requires mbed TLS 2.7.0 or newer

Signed-off-by: James Almer <jamrial@gmail.com>
2018-05-30 14:08:35 -03:00
erankor
500e638711 qt-faststart - stricter input validations
1. validate the moov size before checking for cmov atom
2. avoid performing arithmetic operations on unvalidated numbers
3. verify the stco/co64 offset count does not overflow the stco/co64
atom (not only the moov atom)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-30 02:42:10 +02:00
Michael Niedermayer
42f40d36b7 avcodec/allcodecs: Provide empty codec_list in allcodecs when ossfuzz is used
The last workaround is not sufficient to make oss fuzz work with the iterate API
as it did not provide a FFmpeg that external libs can be linked to.

This patch does not fully restore the pre iterate functionality. My attempts to
do this have so far failed.

The problem with this solution is that it renders the fuzzers virtual system
ffmpeg (libs) non functional. Which differs from a real system compared to the
virtual system tested by the fuzzer.
It should theoretically not matter as the system ffmpeg wouldnt be used.
But with more cases being fuzzed we likely will hit a case where a external
lib is involved and it does matter ...

Working around this may be possible with weak symbols but so far my attempts
failed

Alternatively multiple ffmpeg could be built, this becomes messy though
quickly as they need to be all linked together. That is we need a FFmpeg
that has the iterate API modified so it can work with the resources
available to ossfuzz. And at the same time we need a ffmpeg that has
its full functionality for any external libs which use ffmpeg and are
used by ffmpeg.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-28 23:17:32 +02:00
Michael Niedermayer
64f59a21b3 avcodec: Disable new iterate API for ossfuzz
A few days ago ossfuzz stoped testing new FFmpeg as it run out of diskspacee

https://oss-fuzz-build-logs.storage.googleapis.com/index.html

An alternative would be to revert the API.

This changes for example
-rwxr-x--- 1 michael michael 144803654 May 14 12:54 tools/target_dec_ac3_fixed_fuzzer*
to
-rwxr-x--- 1 michael michael  30333852 May 14 12:51 tools/target_dec_ac3_fixed_fuzzer*

Which should massively decrease space requirements

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-16 00:39:52 +02:00
Josh de Kock
89029bd2c7 lav*,tests: remove several register_all calls
avdevice_register_all() is still required to register devices into
lavf (this is required due to lavd being somewhat of a hack).

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-04-02 03:26:22 +01:00
Marton Balint
25a2d269bd fftools, tools, examples: migrate to AVFormatContext->url
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
Rostislav Pehlivanov
6b35a83214 Remove the ffserver program
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-06 18:31:37 +00:00
Nicolas George
01735b4852 tools/uncoded_frame: remove use of AVStream.codec. 2018-01-06 15:03:38 +01:00
Nicolas George
34dfe36971 tools/uncoded_frame: use buffersink accessors.
No longer access buffersink's link structure directly.
2018-01-06 15:03:38 +01:00
James Almer
503164b54b Revert "tools/uncoded_frame: remove usage of avfilter_link_get_channels()"
This reverts commit 01c21653ee.

It was applied by accident before it could be reviewed.
2018-01-05 22:13:18 -03:00
James Almer
01c21653ee tools/uncoded_frame: remove usage of avfilter_link_get_channels()
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 17:49:27 -03:00
Kelly Ledford
309ddcbe61 patcheck: Add 'threshhold' to common typo list
Signed-off-by: Kelly Ledford <kelly.ledford@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-13 12:25:44 +01:00
Mark Thompson
79a26ef802 tools/cl2c: Add a copyright header 2017-11-22 23:55:23 +00:00
Mark Thompson
59d6529333 lavfi: Add infrastructure for building OpenCL source into libavfilter 2017-11-22 23:17:34 +00:00
James Almer
460e7596cb Merge commit 'f19fbfbdc637e08ad5c980807ede2d023f20c049'
* commit 'f19fbfbdc637e08ad5c980807ede2d023f20c049':
  aviocat: Check for output write errors

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 13:55:35 -03:00
James Almer
f87ad3a058 Merge commit 'e41daa62465036ad36ad0bd14e4936e848d7f07e'
* commit 'e41daa62465036ad36ad0bd14e4936e848d7f07e':
  Remove support for building for mingw32ce (Windows CE)

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 10:22:11 -03:00
Michael Niedermayer
c23209f63d tools/target_dec_fuzzer: Fix build after AV_CODEC_CAP_HWACCEL_VDPAU was removed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 21:50:37 +02:00
Michael Niedermayer
e6debcaaed tools/target_dec_fuzzer: Fix build after FF_INPUT_BUFFER_PADDING_SIZE was removed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-25 21:50:37 +02:00
James Almer
2f7ca0b94e tools/ismindex: remove unused header 2017-10-01 18:19:14 -03:00
Martin Storsjö
f19fbfbdc6 aviocat: Check for output write errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-04 09:42:52 +03:00
Martin Storsjö
e41daa6246 Remove support for building for mingw32ce (Windows CE)
The toolchain for this target is unmaintained since many years.

While it has been continuously build tested on fate, it hasn't
actually been tested at runtime since many, many years (and back
then, only a few codecs in libavcodec were tested).

So far, keeping support for it has been mostly effortless, but
the compiler does seem to have issues with dllimported data symbols,
ending up as internal compiler errors in some cases. Instead of
jumping through further hoops to work around that, just remove the
target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:21:08 +03:00
Diego Biurrun
fd502f4f5f build: Generalize yasm/nasm-related variable names
None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4)

Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-21 17:00:29 -03:00
Paul B Mahol
6e09e12641 tools/sofa2wavs: add license header
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-12 22:14:30 +02:00
Paul B Mahol
1a30bf60be tools: add sofa2wavs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-12 18:08:52 +02:00
Michael Niedermayer
718f8a01df tools/target_dec_fuzzer: Move the hwaccel check outside the initialization if
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-29 03:40:47 +02:00
Michael Niedermayer
38e79d9d9c tools/target_dec_fuzzer: Do not attempt to fuzz VDPAU, its not supported
Fixes: 1364/clusterfuzz-testcase-minimized-6459843441328128
Fixes: 1392

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 15:15:14 +02:00
Michael Niedermayer
d58fe01774 tools/target_dec_fuzzer: Do not use codec_id to look up decoder, but use selected decoder directly
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-06 15:12:05 +02:00
Michael Niedermayer
390c6ee42c tools/target_dec_fuzzer: Fix memleak on open failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-04 13:51:50 +02:00
Michael Niedermayer
dec2fa8cc7 tools/target_dec_fuzzer: Use decoder and not codec_id as argument
This allows fuzzing decoders with the same codec_id
We also avoid register all to allow the linker to prune unused sections and symbols

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-03 17:22:13 +02:00
Michael Niedermayer
56ddb923c6 tools/target_dec_fuzzer: Use avcodec_register_all() instead of register_all()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-02 00:55:19 +02:00
Michael Niedermayer
a9b5b6a97f tools: Eliminate codec_type complexity from fuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-30 14:24:51 +02:00
Michael Niedermayer
966cbfbc83 tools/target_dec_fuzzer: Fix return code on open failure
Fixes: 1271/clusterfuzz-testcase-minimized-6095220498235392

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-27 04:25:31 +02:00