aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* swscale/yuv2rgb: Increase YUV2RGB table headroomMichael Niedermayer2016-01-141-2/+2
| | | | | | | | | This makes SWS more robust Fixes: 07650a772d98aa63b0fed6370dc89037/asan_heap-oob_27ddeaf_2657_2c81ff264dee5d9712cb3251fb9c3bbb.264 Fixes: out of array read Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM outMichael Niedermayer2016-01-142-44/+46
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_dynaudnorm: fix possible null pointer dereferencePaul B Mahol2016-01-141-4/+8
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/aacenc_is: replace pow(x, 0.75) by x/sqrtf(sqrtf(x))Claudio Freire2016-01-142-1/+6
| | | | | | | | | | | | | | | This is quite an accurate approximation; testing shows ~ 2ulp error in the floating point result. Tested with FATE. Alternatively, if one wants "full accuracy", one can use powf, or sqrt instead of sqrtf. With powf, one gets 1 ulp error (theoretically should be 0, as 0.75 is exactly representable) on GNU libm, with sqrt, 0 ulp error. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Abstracted into pos_pow34 utility function Signed-off-by: Claudio Freire <klaussfreire@gmail.com>
* lavu/libm: add isfinite fallbackGanesh Ajjanagadde2016-01-132-0/+20
| | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* dca: fix misaligned access in avpriv_dca_convert_bitstreamAndreas Cadhalpun2016-01-141-4/+5
| | | | | | | | | | | src and dst are only 8-bit-aligned, so accessing them as uint16_t causes SIGBUS crashes on architectures like sparc. This fixes ubsan runtime error: load of misaligned address for type 'const uint16_t', which requires 2 byte alignment Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/hls: forbid all protocols except http(s) & fileMaxim Andreev2016-01-141-0/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Check for +-Inf tooMichael Niedermayer2016-01-131-9/+9
| | | | | | | | Fixes out of array read Fixes: 04442da73d935b776d2236282588d4f9/signal_sigsegv_2625a69_8790_ae85ffc889070663319b3417ede777b0.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpackenc: print channel count in av_log callJames Almer2016-01-131-1/+1
| | | | Fixes a warning with -Wformat-extra-args
* avcodec/diracdec: Handle the 0 vlc case at the top of coeff_unpack_golomb()Michael Niedermayer2016-01-131-6/+12
| | | | | | | decoding changes from 17 to 20 fps Reviewed-by; Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/diracdec: Factor +2 out of the inner loopMichael Niedermayer2016-01-131-5/+5
| | | | | Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/diracdec: Inline svq3_get_ue_golomb() and merge the sign bit ↵Michael Niedermayer2016-01-131-3/+34
| | | | | | | | | decoding into it This avoids closing and opening the bit reader Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: mark output as const as its not written toMichael Niedermayer2016-01-131-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Fix NAN checkMichael Niedermayer2016-01-131-1/+9
| | | | | | | | | All MDCT outputs must be checked in case of 128point MDCTs Fixes: out of array read Fixes: 04442da73d935b776d2236282588d4f9/signal_sigsegv_2625a69_351_52ca6226eb83547a2d26e322ce84ed84.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* diracdec: Add slice threading to HQ profileKieran Kunhya2016-01-131-8/+30
|
* AAC encoder: encode out-of-phase I/S efficientlyClaudio Freire2016-01-131-1/+8
| | | | | | | | | | | Use the ability to invert phase with ms_mask instead of changing the codebook when possible, to avoid having to switch codebooks if some bands are INTENSTY_BT and others are INTENSITY_BT2, since usually a set ms_mask uses less bits that a codebook change. While it may not always be a win (ie: if it causes an ms_mask bitmap to be sent when it wouldn't have been otherwise), it's unlikely since the ms_mask bitmap will almost always be there already for M/S itself.
* AAC encoder: fix I/S relative error evaluationClaudio Freire2016-01-132-3/+3
| | | | | | | The relative error between two encoding strategies is the simple difference of rate-distortion values, and not the absolute difference. An absolute measure would allow worsening of the quantization error as well as improving.
* AAC encoder: various fixes in M/S codingClaudio Freire2016-01-133-31/+37
| | | | | | | | | | | | | | | | | | | | 1. Fix sf_idx and band_type addressing to address only the first subwindow in the group (others could hold garbage values) 2. Don't step on ms_mask when is_mask is set. I/S selection already sets the ms_mask properly and shouldn't be overridden. 3. Use mid/sid cb/sf when computing coding error, as should be since those are the cb/sfs that will eventually be set. 4. Fix distortion computation on multi-subwindow groups (was subtracting the bits terms multiple times) 5. Clear ms_mask when one side uses PNS and the other doesn't. When using PNS, ms_mask signals correlated noise, which can be detected just like regular M/S detection, so we don't skip noise bands, but when only one side uses PNS setting the flag can confuse some encoders, so avoid that.
* AAC encoder: in IS, fix index of sf_idx, band_typeClaudio Freire2016-01-131-10/+5
| | | | | | | | | | Correct addressing of sf_idx and band_type arrays in I/S code. Both arrays don't guarantee valid values for subwindows at all times, depending on which coder is being used, which could result in reading of garbage values. Instead, only the first subwindow in the window group has to be used, ie: use w*16+g instead of (w+w2)*16+g
* AAC encoder: don't apply MS on special bandsClaudio Freire2016-01-131-2/+2
| | | | | | | | | Change the condition for application of the M/S transform to match that of the decoder. Namely, that no special coding books must be in use in either channel. While the condition ought to be equivalent to the current one when the invariant of is_mask is kept, matching the decoder's condition is safer and easier to maintain.
* AAC encoder: avoid assertion failure on PNSClaudio Freire2016-01-132-2/+5
| | | | | In rare corner cases it could still fail an assert on sf_diff due to failure to update prev_sf in some code paths. Fix that case.
* AAC encoder: fix assertion error with predictionClaudio Freire2016-01-131-3/+5
| | | | | | | | | | | | Fixes an assertion error reported in #2686 that happens when using prediction (either explicitly or implicitly by setting the AAC main profile), since prediction code would allow creating new zeroes or removing existing ones, without properly checking for SF delta violations. This patch forbids creating/removing zeroes, perhaps an overly conservative approach, but a safe one. More permissive and sophisticated approaches may be attempted in the future.
* lavc/mjpeg2jpeg: Accept more mjpeg streams as input.Carl Eugen Hoyos2016-01-131-4/+5
| | | | Fixes ticket #5151.
* avutil/common: Protect GET_BYTE in GET_UTF8() by ()Michael Niedermayer2016-01-131-2/+2
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aviobuf: Fix end check in put_str16()Michael Niedermayer2016-01-131-0/+2
| | | | | | | | Fixes out of array read Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libvpxdec: fix 'ISO C90 forbids mixed declarations and code' warningJames Zern2016-01-121-1/+1
| | | | | | | | since: cbcc88c libvpx: Support setting color range for vp9. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* configure: showspectrum now uses fft, add showspectrumpicPaul B Mahol2016-01-121-1/+3
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/avf_showspectrum: reduce number of operationsPaul B Mahol2016-01-121-6/+8
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/avf_showspectrum: add posibility to display phasePaul B Mahol2016-01-122-4/+55
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavf/mpjpegdec: Do not call av_log() while probing.Carl Eugen Hoyos2016-01-121-0/+3
|
* avformat/asfenc: Check ptsMichael Niedermayer2016-01-121-0/+5
| | | | | | | | Fixes integer overflow Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/asfenc: Flush packet before duration becomes unrepresentableMichael Niedermayer2016-01-121-0/+5
| | | | | | | | Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov Fixes assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/truemotion2: Cleanup in case of tm2_read_stream() failureMichael Niedermayer2016-01-121-10/+18
| | | | | | | | Fixes memleaks Fixes: 245dae71bc28fe8f3f454300277e575a/signal_sigabrt_7ffff6ae7cb7_5062_f7d9dfa385454806586076f9db48c0bf.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/mjpeg2jpeg: Check for jpeg file header.Carl Eugen Hoyos2016-01-121-0/+5
|
* lavf/matroskadec: Use av_realloc() in get_qt_codec()Mats Peterson2016-01-121-3/+3
| | | | | | | Use av_realloc() rather than av_malloc() when normalizing noncompliant private data in get_qt_codec(). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Correct two build/built typosTimothy Gu2016-01-112-2/+2
| | | | | Found-by: Leo Izen <leo.izen@gmail.com> as thebombzen on IRC Signed-off-by: Timothy Gu <timothygu99@gmail.com>
* avcodec/mpeg4video: Check time_incrMichael Niedermayer2016-01-123-5/+15
| | | | | | | | | | Fixes assertion failure Fixes out of memory access Fixes: test_casex.ivf Found-by: Tyson Smith <twsmith@mozilla.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* rtmpdh: Initialize gcrypt before using itRicardo Constantino2016-01-121-1/+10
| | | | | | | | | | | | | | | | | | | | | | Either disabling or init'ing secure memory is required after the use of gcry_check_version. From a look at the functions rtmpdh uses, I noticed none require the use of secure memory, so we disable it [1][2]. This resolves some errors returned by rtmpdh code with uninitialized gcrypt, especifically: Fatal: failed to create the RNG lock: Invalid argument FATAL: failed to acquire the FSM lock in libgrypt: Invalid argument Version "1.5.4" was arbitrarily chosen. An older version probably works as well, but I couldn't compile older versions to test on my machine. [1] https://gnupg.org/documentation/manuals/gcrypt/Initializing-the-library.html [2] https://www.gnupg.org/documentation/manuals/gcrypt/Controlling-the-library.html Signed-off-by: Ricardo Constantino <wiiaboo@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* diracdec: fix idwt_stride calculation in bytesAndreas Cadhalpun2016-01-121-1/+1
| | | | | | | | | | | | The transformation to bytes must happen after alignment to get the same resulting pointers as before. This fixes segmentation faults in the assembler code. The regression was introduced in commit 9553689. Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* lavc/cbrt_tablegen: speed up tablegenGanesh Ajjanagadde2016-01-111-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This exploits an approach based on the sieve of Eratosthenes, a popular method for generating prime numbers. Tables are identical to previous ones. Tested with FATE with/without --enable-hardcoded-tables. Sample benchmark (Haswell, GNU/Linux+gcc): prev: 7860100 decicycles in cbrt_tableinit, 1 runs, 0 skips 7777490 decicycles in cbrt_tableinit, 2 runs, 0 skips [...] 7582339 decicycles in cbrt_tableinit, 256 runs, 0 skips 7563556 decicycles in cbrt_tableinit, 512 runs, 0 skips new: 2099480 decicycles in cbrt_tableinit, 1 runs, 0 skips 2044470 decicycles in cbrt_tableinit, 2 runs, 0 skips [...] 1796544 decicycles in cbrt_tableinit, 256 runs, 0 skips 1791631 decicycles in cbrt_tableinit, 512 runs, 0 skips Both small and large run count given as this is called once so small run count may give a better picture, small numbers are fairly consistent, and there is a consistent downward trend from small to large runs, at which point it stabilizes to a new value. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* ffmdec: change type of len to ptrdiff_tAndreas Cadhalpun2016-01-111-2/+3
| | | | | | | | | | It is used to store the difference between pointers, so ptrdiff_t is the correct type. This prevents potential overflows. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* qtpalette: make the color_* variables unsigned againAndreas Cadhalpun2016-01-111-1/+1
| | | | | | | | | | This fixes segmentation faults due to out of bounds writes, when color_start is interpreted as negative number. This regression was introduced in commit 57631f. Reviewed-by: Mats Peterson <matsp888@yahoo.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec/wavpackenc: Check the number of channelsMichael Niedermayer2016-01-111-0/+5
| | | | | | They are stored in a byte, thus more than 255 is not possible Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpackenc: Headers are per channelMichael Niedermayer2016-01-111-1/+1
| | | | | | | | Fixes: 1b8b83a53bfa751f01b1daa65a4758db/signal_sigabrt_7ffff6ae7cb7_7488_403f71d1a2565b598d01b6cb110fac8f.aiff Fixes: assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dfa: Fix packet leak on errorMichael Niedermayer2016-01-111-0/+1
| | | | | | | Fixes: 07fa81f300736485e585b63e7b1cd155/signal_sigabrt_7ffff6ae7cb7_16_94ee815791a1357826524072db5bc2dc.dfa Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/matroskadec: Normalize noncompliant A_QUICKTIME/V_QUICKTIME private dataMats Peterson2016-01-111-13/+35
| | | | | | | | | | | | | This patch adds a new static function get_qt_codec() that takes care of the initial retrieval of the fourcc and codec ID for A_QUICKTIME and V_QUICKTIME. It also normalizes noncompliant private data found in some older files that incorrectly starts with the fourcc by expanding/shifting the data by 4 bytes, and storing the data size at the start. This is necessary in order for the rest of the code in the A_QUICKTIME and V_QUICKTIME blocks (and most likely other code as well) to correctly parse the private data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3enc: Remove duplicate #includeMichael Niedermayer2016-01-111-1/+0
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Check id_mapMichael Niedermayer2016-01-101-0/+4
| | | | | | | | Fixes index out of bounds error Fixes: aac_index_out_of_bounds.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdec: Fix "left shift of negative value -254"Michael Niedermayer2016-01-101-1/+1
| | | | | | | Fixes: dvdec_left_shift.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g2meet: Check for ff_els_decode_bit() failure in ↵Michael Niedermayer2016-01-101-1/+6
| | | | | | | | | | epic_decode_run_length() Fixes invalid shift Fixes: g2m_left_shift_2.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>