summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/bitstream: Don't check for undefined behaviour after it happenedAndreas Rheinhardt2020-06-27
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/jpeg2000dec.c Fixed WRITE_FRAME and tile co-ordinates:Gautam Ramakrishnan2020-06-27
| | | | | | | | | | libopenjpeg2000 uses ceiling division while dividing tile co-ordinates with the sample separation. Also, corrections were made to the WRITE_FRAME macro. Improves: p1_01.j2k and p1_07.j2k Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/jpeg2000dec.c: Modify image dimensionsGautam Ramakrishnan2020-06-27
| | | | | | | | | | Reduce image size of the image if all components have a non zero sample separation. This is to replicate the output of opj_decompress. Improves: p1_01.j2k Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adpcm_ima_apm: support new extradata formatZane van Iperen2020-06-26
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12dec: switch to AVBufferRef buffer for a53 captionLimin Wang2020-06-26
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: add AV1 profiles to profile.hJames Almer2020-06-25
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: set default VUI parameters when ↵James Almer2020-06-25
| | | | | | | | | | vui_parameters_present_flag is false Based on cbs_h264 code. Should fix ticket #8752. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/aac_ac3_parser: improve the raw AAC file bit rate calculationJun Zhao2020-06-26
| | | | | | | | | | | | | | | | | | | Now we just use one ADTS raw frame to calculate the bit rate, it's lead to a larger error when get the duration from bit rate, the improvement cumulate Nth ADTS frames to get the average bit rate. e,g used the command get the duration like: ffprobe -show_entries format=duration -i fate-suite/aac/foo.aac before this improvement dump the duration=2.173935 after this improvement dump the duration=1.979267 in fact, the real duration can be get by command like: ffmpeg -i fate-suite/aac/foo.aac -f null /dev/null with time=00:00:01.97 Also update the fate-adtstoasc_ticket3715. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avcodec/cbs_av1: Simplify writing uvlc elementsAndreas Rheinhardt2020-06-24
| | | | | | | There is no reason to special-case writing a value of zero as uvlc element as the generic code is perfectly capable of doing so. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/cbs_av1: Fix writing uvlc numbers >= INT_MAXAndreas Rheinhardt2020-06-24
| | | | | | | | | | Fixes: assertion failure Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 23264/clusterfuzz-testcase-minimized-ffmpeg_BSF_AV1_METADATA_fuzzer-6308429248593920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hevc: export chroma sample locationHendrik Leppkes2020-06-24
|
* avcodec/ccaption_dec: add support for background colorsPaul B Mahol2020-06-23
|
* lavc: Lower MediaFoundation audio encoder priority.Carl Eugen Hoyos2020-06-23
| | | | | The actual encoders may not be available. Fixes ticket #8699.
* avcodec, avformat: Remove unnecessary initializations of side data sizeAndreas Rheinhardt2020-06-22
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/packet: Improve documentation of av_packet_get_side_dataAndreas Rheinhardt2020-06-22
| | | | | | | | Document that it also sets the size in case the desired side data is absent (if the pointer has been supplied). Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/nellymoserdec: Don't use invalid AVPacketSideDataTypeAndreas Rheinhardt2020-06-22
| | | | | | | | | | | | | | | | | | | Commits 957a593cd95b15a5dcb2f50306fbac59f09d8e9e and 11828b8885cc1d87ffc7b1b4bbe642ce9720b194 made the flv demuxer export a certain flag as side data to be used by the nellymoser decoder for mid-stream sample rate changes. It used a custom side data type 'F' that was never officially documented. Yet since 2215c39e94e01f57b3191a29e0e51d7e230daf49 (merged in commit 52c522c72090233edeeb0486a9bd8bee925a710a) this information is exported via the properly documented AV_PKT_DATA_PARAM_CHANGE side data. The merge commit therefore stopped exporting the 'F' sidedata; yet the changes in the Nellymoser decoder (which are now dead code (and would become dangerous if lots of new side data types were added)) have not been removed. This commit does this. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hcadec: get intensity from correct channelsummertriangle.dev@gmail.com2020-06-21
| | | | | | | Fixes an issue with one output channel being slightly louder than the other. The output now matches other public HCA decoders. Signed-off-by: t <summertriangle.dev@gmail.com>
* avcodec/hcadec: fix decoding of hfr channelssummertriangle.dev@gmail.com2020-06-21
| | | | | | | | I suspect this was originally broken by b7e5c8f , but even then, it only worked because it read out of bounds from intensity_ratio_table. Signed-off-by: t <summertriangle.dev@gmail.com>
* avcodec/adpcmenc: remove forward declarationAndriy Gelman2020-06-20
| | | | | Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avcodec/mpeg12dec: do not discard older a53 captionsPaul B Mahol2020-06-20
| | | | Fixes #6105.
* avcodec/ccaption_dec: use uint8_t type for prev_cmd arrayPaul B Mahol2020-06-20
| | | | Commands are unsigned so be consistent.
* avcodec/ccaption_dec: do not modify packet data in case of parity errorPaul B Mahol2020-06-20
| | | | To dissallow similar errors in future, make pointers const.
* avcodec/ccaption_dec: allow selection of second field captionsPaul B Mahol2020-06-20
|
* avcodec/ccaption_dec: rework non-real-time mode with pop-on captions by delayingPaul B Mahol2020-06-20
| | | | So it give similar output as visual output of real-time mode.
* avcodec/av1_parser: initialize avctx->pix_fmtManoj Bonda2020-06-19
| | | | | | | | | | | Initialize avctx->pix_fmt in av1_parser.c AV1 Chroma format is invalid when quering using below code if no AV1 decoder is available: iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0); eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->format; Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1_parser: add missing parsing for RGB pixel format signalingJames Almer2020-06-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/av1_parser: set context values outside the OBU parsing loopJames Almer2020-06-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: Fix integer overflow in computation of max and avg bitrateLimin Wang2020-06-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/encode: restructure the old encode APIJames Almer2020-06-18
| | | | | | | Following the same logic as 061a0c14bb, this commit turns the old encode API into a wrapper for the new one. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/encode: restructure the core encoding codeJames Almer2020-06-18
| | | | | | | | | | | | | | | | This commit follows the same logic as 061a0c14bb, but for the encode API: The new public encoding API will no longer be a wrapper around the old deprecated one, and the internal API used by the encoders now consists of a single receive_packet() callback that pulls frames as required. amf encoders adapted by James Almer librav1e encoder adapted by James Almer nvidia encoders adapted by James Almer MediaFoundation encoders adapted by James Almer vaapi encoders adapted by Linjie Fu v4l2_m2m encoders adapted by Andriy Gelman Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/ccaption_dec: do not modify pkt data and stop removing parity bit twicePaul B Mahol2020-06-17
|
* avcodec/ccaption_dec: remove usage of extra bufferPaul B Mahol2020-06-16
|
* avcodec/ccaption_dec: fix some small style issuesPaul B Mahol2020-06-16
|
* avcodec/ccaption_dec: remove pts parameter from handle_char()Paul B Mahol2020-06-16
|
* avcodec/tiff: Check stride for dngMichael Niedermayer2020-06-15
| | | | | | | | Fixes: assertion failure Fixes: 23422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5746026064642048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ccaption_dec: add support for colorsPaul B Mahol2020-06-15
|
* avcodec/iirfilter: Fix memleakAndreas Rheinhardt2020-06-15
| | | | | | | | | | | | | | | Commit 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 created a memleak by removing a call to ff_iir_filter_free_coeffsp on error; this has been found by Coverity (ID 1464159). This commit fixes the memleak by readding the call to ff_iir_filter_free_coeffsp. Notice that this is not a simple revert, because several macros that were used before 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 were replaced in commit 44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4 and completely removed in 2658680df4fc606522e5f65899afb9a98b47d287. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/hevc_mp4toannexb_bsf: Check NAL size against available inputAndreas Rheinhardt2020-06-15
| | | | | | | | | | | | | | | The hevc_mp4toannexb bsf does not explicitly check whether a NAL unit is so big that it extends beyond the end of the input packet; it does so only implicitly by using the checked version of the bytestream2 API. But this has downsides compared to real checks: It can lead to huge allocations (up to 2GiB) even when the input packet is just a few bytes. And furthermore it leads to uninitialized data being output. So add a check to error out early if it happens. Also check directly whether there is enough data for the length field. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h264: create user data unregistered SEI side data for H.264Limin Wang2020-06-15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/hevc_sei: add support for user data unregistered SEI messageLimin Wang2020-06-15
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/cbs_av1: abort when written inferred values don't matchJames Almer2020-06-14
| | | | | | | | | | If this happens, it's a sign of parsing issues earlier in the process, or misuse by the calling module. Prevents writing invalid bitstreams. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: abort when written inferred values don't matchJames Almer2020-06-14
| | | | | | | | | | If this happens, it's a sign of parsing issues earlier in the process, or misuse by the calling module. Prevents writing invalid bitstreams. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libzvbi-teletextdec: fix txt_default_region limitsMarton Balint2020-06-14
| | | | | | | Max region ID is 87. Also the region affects not only the G0 charset but G2 and the national subset as well. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/ffwavesynth: Avoid undefined operation on ts overflowMichael Niedermayer2020-06-14
| | | | | | | | | Alternatively these conditions could be treated as errors Fixes: 23147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5639254549200896 Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'int64_t' (aka 'long') Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mv30: check mode_size vs. input spaceMichael Niedermayer2020-06-14
| | | | | | | | Fixes: Timeout (longer than my patience vs 1sec) Fixes: 22984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5630021988515840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Fix 2 integer overflows in get_amv()Michael Niedermayer2020-06-14
| | | | | | | | Fixes: signed integer overflow: -144876608 * 16 cannot be represented in type 'int' Fixes: 22782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6039584977977344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/jpeg2000dec: Fix/check for multiple integer overflowsMichael Niedermayer2020-06-14
| | | | | | | | Fixes: shift exponent 35 is too large for 32-bit type 'int' Fixes: 22857/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5202709358837760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/lossless_audiodsp: Fix undefined overflows in ↵Michael Niedermayer2020-06-14
| | | | | | | | | | scalarproduct_and_madd_int16_c() Fixes: signed integer overflow: 2142077091 + 6881070 cannot be represented in type 'int' Fixes: 22737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5958388889681920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sonic: Fix several integer state overflowsMichael Niedermayer2020-06-14
| | | | | | | | | Fixes: signed integer overflow: -234 * -14797801 cannot be represented in type 'int' Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5695924975435776 Fixes: 22275/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5695924975435776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/sonic: Fix several integer overflowsMichael Niedermayer2020-06-14
| | | | | | | | Fixes: signed integer overflow: 2129689466 + 2129689466 cannot be represented in type 'int' Fixes: 20715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5155263109922816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>