aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
Commit message (Collapse)AuthorAgeFilesLines
* avutil/lfg: Correct index increment type to avoid undefined behaviorMichael Niedermayer2020-07-011-3/+6
| | | | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 18333/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COMFORTNOISE_fuzzer-5668481831272448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6014bcf1b74e903f535461ade4aa5fb44dbf5d8b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mem: Fix invalid use of av_alloc_sizeMark Harris2019-07-231-1/+1
| | | | | | | | | | | | The alloc_size attribute is valid only on functions that return a pointer. GCC 9 (not yet released) warns about invalid usage: ./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes] 342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size); | ^~~~~~~~~~~~~ Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4361293fcf59edb56879c36edcd25f0a91e0edf8)
* avutil/avstring: Fix bug and undefined behavior in av_strncasecmp()Michael Niedermayer2019-05-091-2/+3
| | | | | | | | | | | The function in case of n=0 would read more bytes than 0. The end pointer could be beyond the allocated space, which is undefined. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6f0e9a863466bfcbd75ee15d4d8a6aad2a5126a4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mem: Optimize fill32() by unrolling and using 64bitMichael Niedermayer2019-03-241-0/+12
| | | | | | | Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 12b1338be376a3e5fb606d9fe41b58dc4a9e62c7) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/integer: Fix integer overflow in av_mul_i()Michael Niedermayer2018-11-181-1/+1
| | | | | | | Found-by: fate Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3cc3cb663bf3061e40356392d2f7638de6a479fe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/pixfmt: Document chroma plane size for odd resolutionsMichael Niedermayer2018-11-181-0/+4
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit be0b77e6e83b61c2da338201b5ddfae1c9acedc5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Fix undefined behavior in av_clip_uintp2_c()Michael Niedermayer2018-07-081-1/+1
| | | | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 8521/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5639024952737792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit aa41d322be71106ce147445f2b42bb763f1eff86) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/common: Fix integer overflow in av_clip_uint8_c() and av_clip_uint16_c()Michael Niedermayer2018-07-081-2/+2
| | | | | | | | | | Fixes: 5567/clusterfuzz-testcase-minimized-5769966247739392 Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ab6f571ef71967da7c7c1cfba483d3597c7357d5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/softfloat: Add FLOAT_MINMichael Niedermayer2018-01-081-0/+1
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit e34fe61bf45331d2e6d2840604f799fa4b55c843) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/softfloat: Fix sign error in and improve documentation of av_int2sf()Michael Niedermayer2017-06-161-2/+4
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6019d721d4c10bf73018d68511d9d0a914c0a389) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/internal: Do not enable CHECKED with DEBUGMichael Niedermayer2017-06-161-3/+2
| | | | | | | | | | | This avoids potential undefined behavior in debug mode while still allowing developers which want to check for potential additional overflows to do so by manually enabling this. Reviewed-by: wm4 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a44b3abb4cf922e379fbac55452d0482a8223597) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/hwcontext_dxva2: Don't improperly free IDirect3DSurface9 objectsAaron Levinson2017-05-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | Add dxva2_pool_release_dummy() and use it in call to av_buffer_create() in dxva2_pool_alloc(). Prior to this change, av_buffer_create() was called with NULL for the third argument, which indicates that av_buffer_default_free() should be used to free the buffer's data. Eventually, it gets to buffer_pool_free() and calls buf->free() on a surface object (which is av_buffer_default_free()). This can result in a crash when the debug version of the C-runtime is used on Windows. While it doesn't appear to result in a crash when the release version of the C-runtime is used on Windows, it likely results in memory corruption, since av_free() is being called on memory that was allocated using IDirectXVideoAccelerationService::CreateSurface(). Signed-off-by: Aaron Levinson <alevinsn@aracnet.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Reviewed-by: Mark Thompson <sw@jkqxz.net> (cherry picked from commit 0c1c514643d5e1645160d697fa4c27cd38c7c791)
* avutil/softfloat: Fix overflow in av_div_sf()Michael Niedermayer2017-05-141-1/+8
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 277e397eb5964999bd76909f52d4bd3350289c22) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/softfloat: Fix multiple runtime error: left shift of negative value -8Michael Niedermayer2017-05-141-2/+2
| | | | | | | | | Fixes: 1352/clusterfuzz-testcase-minimized-5757565017260032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 35f3df0d76e28969fa77f2b865e2e40b3ba69722) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Add CHECK/SUINT codeMichael Niedermayer2017-05-141-0/+14
| | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4614bf2caf67a89c2d833b3368f325eab54582bc) (cherry picked from commit e8d4eacc07c61ae24f48451073a2620d8d257d33) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* hwcontext_vdpau: Fix missing subscriptsMark Thompson2017-05-091-2/+2
| | | | | | | | Also remove the redundant casts which were hiding the error here. Fixes Ubuntu bug 1688735, reported by andysem. (cherry picked from commit 7081620aca36e616ea96f71fd71d2703e3abae09)
* avutil/random_seed: Reduce the time needed on systems with very low ↵Michael Niedermayer2017-01-261-1/+1
| | | | | | | | | | | precission clock() This should fix issues on BSD CLOCKS_PER_SEC is 128 on BSD while SUSv2 requires it to be a million Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/random_seed: Improve get_generic_seed() with higher precission clock()Michael Niedermayer2017-01-261-4/+6
| | | | | | | Tested-by: Thomas Turner <thomastdt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit da73d95bad4736c5e0a6b4b1a811f4dd4525bb4c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: Add av_image_check_size2()Michael Niedermayer2016-12-113-6/+39
| | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit f542b152aa2086b30d1089162d79f5c136905c0c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* softfloat: decrease MIN_EXP to cover full float rangeAndreas Cadhalpun2016-11-251-1/+1
| | | | | | | | | | floats are not necessarily normalized, so a normalized softfloat needs MIN_EXP lowered by 23 to cover that range. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 2d6f46d801bab990b7e742b8a8e5c5b0cb70a80e) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* softfloat: handle -INT_MAX correctlyAndreas Cadhalpun2016-11-171-1/+1
| | | | | | | | | This is similar to commit 9ac61e73d0843ec4b83f4e3d47eded73234e406e. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 0edd569466eb45b134690b9f4efbb57eda86f58d) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Revert "Bump minor versions after 3.2 branchpoint to seperate release"Michael Niedermayer2016-10-261-1/+1
| | | | | | this should only have been on master This reverts commit 1609935b6cbe3fb77f27257cabefbee3f7118dc3.
* Bump minor versions after 3.2 branchpoint to seperate releaseMichael Niedermayer2016-10-261-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump minor versions for 3.2Michael Niedermayer2016-10-261-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu: remove comma at final enumeration items to fix pedantic warningsMichael Behrisch2016-10-262-7/+7
|
* avutil/x86/emms: Document the emms_c() vs alloc/free relation.Michael Niedermayer2016-10-231-0/+2
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mips: loongson add mmi utils header fileZhou Xiaoyong2016-10-231-0/+241
| | | | | | | 1.mmiutils.h defined MMI_ load/store macros for loongson2e/2f/3a 2.mmiutils.h defined some mmi assembly macors Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/avassert: Add av_assertX_fpu()Michael Niedermayer2016-10-223-1/+23
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc: fix spelling errorsAndreas Cadhalpun2016-10-212-2/+2
| | | | | | | | Thanks to Mathieu Malaterre <malat@debian.org> for reporting the Que/Queue typo. (https://bugs.debian.org/839542) Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avutil: Improved selftest coverage for libavutil/fifo.cThomas Turner2016-10-141-2/+37
| | | | | | Tested functions: av_fifo_generic_peek(), av_fifo_grow() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/audio_fifo: Use av_fifo_freep() and remove redundant if()Michael Niedermayer2016-10-141-2/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/hwcontext_vdpau: Fix warning: "GET_CALLBACK" redefinedMichael Niedermayer2016-10-101-0/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'fe498ef5144d3712b887f44a0c5e654add99ead7'Hendrik Leppkes2016-10-071-111/+79
|\ | | | | | | | | | | | | * commit 'fe498ef5144d3712b887f44a0c5e654add99ead7': hwcontext_vaapi: Return all formats for constraints without config Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * hwcontext_vaapi: Return all formats for constraints without configMark Thompson2016-06-211-111/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer make a dummy device configuration to query. Instead, just return everything we recognise from the whole format list. Also change the device setup code to query that list only, rather than intersecting it with the constraint output. This makes hwupload more usable on mesa/gallium where the video processor only declares support for RGB formats, making it unable to deal with YUV formats before this patch. It might introduce some different trickier failures in the internal upload/download code because the set of allowed formats there has changed, though I didn't find any obvious regressions with i965.
* | Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'Hendrik Leppkes2016-10-073-1/+16
|\| | | | | | | | | | | | | * commit '32c8359093d1ff4f45ed19518b449b3ac3769d27': lavc: export the timestamps when decoding in AVFrame.pts Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: export the timestamps when decoding in AVFrame.ptsAnton Khirnov2016-06-213-0/+11
| | | | | | | | | | | | | | | | | | | | | | Currently it's exported as AVFrame.pkt_pts, which is also the only use for that field. The reason it is done like this is that lavc used to export various codec-specific "timing" information in AVFrame.pts, which is not done anymore. Since it is confusing to the callers to have a separate field which is used only for decoder timestamps and nothing else, deprecate pkt_pts and use just AVFrame.pts everywhere.
* | pixfmt: Use enum assignment for aliasesTimothy Gu2016-10-051-4/+2
| | | | | | | | | | | | | | This way, Doxygen is happier as aliases are now grouped together, and it never handled #define's in an enum well in the first place. Y400A already exists as an enum assignment.
* | pixdesc: Order function prototypes semanticallyTimothy Gu2016-10-051-97/+97
| |
* | avutil/mips/generic_macros_msa: rename macro variable which causes segfault ↵Shivraj Patil2016-10-051-6/+6
| | | | | | | | | | | | | | for mips r6 Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/hwcontext_cuda: align allocated framesTimo Rothenpieler2016-10-031-15/+20
| |
* | avutil/hwcontext_cuda: use proper synchronization flagTimo Rothenpieler2016-09-291-1/+1
| |
* | avutil/hwcontext: use CONFIG_QSV instead of CONFIG_LIBMFX for qsvJames Almer2016-09-282-3/+3
| | | | | | | | | | | | | | See "[FFmpeg-devel] [PATCH] hwcontext: add a QSV implementation" Suggested-by: nablet developer <sdk@nablet.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da'James Almer2016-09-287-1/+853
|\| | | | | | | | | | | | | | | | | | | | | * commit '59e7361cc791e5103be1712dc59a2055f118d0da': hwcontext: add a QSV implementation Conflicts: doc/APIchanges libavutil/version.h Merged-by: James Almer <jamrial@gmail.com>
| * hwcontext: add a QSV implementationAnton Khirnov2016-06-217-1/+853
| |
* | Merge commit 'a8164323374e86ce5f93759230868c98356833a2'James Almer2016-09-283-2/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a8164323374e86ce5f93759230868c98356833a2': pixdesc: Add new SMPTE 431, 432, and 2085 color properties Conflicts: libavcodec/options_table.h libavcodec/version.h libavutil/pixdesc.c libavutil/pixfmt.h libavutil/version.h Merged-by: James Almer <jamrial@gmail.com>
| * pixdesc: Add new SMPTE 431, 432, and 2085 color propertiesVittorio Giovara2016-06-213-1/+7
| | | | | | | | | | | | Appeared in H.264 2016/02. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * pixfmt: Add ARIB STD-B76 color transfer characteristicNeil Birkbeck2016-06-213-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding hybrid log-gamma (https://en.wikipedia.org/wiki/Hybrid_Log-Gamma) based on the standardization in ARIB STD-B67: http://www.arib.or.jp/english/html/overview/doc/2-STD-B67v1_0.pdf The choice of enum value of 18 is consistent with HEVC: http://phenix.it-sudparis.eu/jct/doc_end_user/current_document.php?id=10481 And also with latest proposal for color format in mkv: https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&q=Colour+Format+proposal Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avutil/frame: Add a flag to discard frame after decode.Sasi Inguva2016-09-193-1/+6
| | | | | | | | | | Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu/timestamp: Avoid C++-unfriendly code in user headerMark Thompson2016-09-011-1/+1
| | | | | | | | | | | | Including this header in a C++11 program (inside extern "C") will throw an error because it looks like a user-defined literal. Add a space between the two tokens to avoid the problem.
* | avutil/version: Improve lib versioning scheme for release branches with the ↵Michael Niedermayer2016-08-291-0/+9
| | | | | | | | | | | | next major release Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>