summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/wavpack: Fix runtime error: left shift of negative value -5Michael Niedermayer2017-03-08
| | | | | | | Fixes: 729/clusterfuzz-testcase-5154831595470848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pictordec: Fix runtime error: left shift of 64 by 25 places cannot ↵Michael Niedermayer2017-03-08
| | | | | | | | | be represented in type 'int' Fixes: 724/clusterfuzz-testcase-6738249571631104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libx265: Add gray10 and gray12 encoding support.Carl Eugen Hoyos2017-03-08
|
* avcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()Michael Niedermayer2017-03-07
| | | | | | | | Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 2 of 2) Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: BBB Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()Michael Niedermayer2017-03-07
| | | | | | | | Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 1 of 2) Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: BBB Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp8: remove redundant checkMichael Niedermayer2017-03-07
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/allcodecs: make avcodec_register_all thread safeMuhammad Faiz2017-03-07
| | | | | | | use ff_thread_once Suggested-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* avcodec/pixlet: fix architecture-dependent code and valuesVittorio Giovara2017-03-07
| | | | | | | | | | | | | The constants used in the decoder used floating point precision, and this caused different values to be generated on different architectures. So, eradicate floating point numbers and use fixed point (32.32) arithmetics everywhere, replacing constants with precomputed integer values. Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com> Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/h264, videotoolbox: fix crash after VT decoder failsAman Gupta2017-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way videotoolbox hooks in as a hwaccel is pretty hacky. The VT decode API is not invoked until end_frame(), so alloc_frame() returns a dummy frame with a 1-byte buffer. When end_frame() is eventually called, the dummy buffer is replaced with the actual decoded data from VTDecompressionSessionDecodeFrame(). When the VT decoder fails, the frame returned to the h264 decoder from alloc_frame() remains invalid and should not be used. Before 9747219958060d8c4f697df62e7f172c2a77e6c7, it was accidentally being returned all the way up to the API user. After that commit, the dummy frame was unref'd so the user received an error. However, since that commit, VT hwaccel failures started causing random segfaults in the h264 decoder. This happened more often on iOS where the VT implementation is more likely to throw errors on bitstream anomolies. A recent report of this issue can be see in http://ffmpeg.org/pipermail/libav-user/2016-November/009831.html The issue here is that the dummy frame is still referenced internally by the h264 decoder, as part of the reflist and cur_pic_ptr. Deallocating the frame causes assertions like this one to trip later on during decoding: Assertion h->cur_pic_ptr->f->buf[0] failed at src/libavcodec/h264_slice.c:1340 With this commit, we leave the dummy 1-byte frame intact, but avoid returning it to the user. This reverts commit 9747219958060d8c4f697df62e7f172c2a77e6c7. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* lavc/libvpxenc: add -row-mt optionKagami Hiiragi2017-03-06
| | | | Signed-off-by: James Zern <jzern@google.com>
* avcodec/proresdec2: Do not discard frames with bad slicesMichael Niedermayer2017-03-06
| | | | | | The code previously completely discarded frames that had any error in a slice Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/x86/cavsdsp: Put MMX code under mmx checkMichael Niedermayer2017-03-06
| | | | | | | Without this the FPU state becomes trashed and causes mysterious fate failures with cpuflags=0 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/movtextdec: Call mov_text_cleanup() on closeMichael Niedermayer2017-03-06
| | | | | | | | Fixes memleak Fixes: 548/clusterfuzz-testcase-5511470875934720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: consider an error during decoder draining as EOFwm42017-03-06
| | | | | | | | | | | | | | There is no reason that draining couldn't return an error or two. But some decoders don't handle this very well, and might always return an error. This can lead to API users getting into an infinite loop and burning CPU, because no progress is made and EOF is never returned. In fact, ffmpeg.c contains a hack against such a case. It is made unnecessary with this commit, and removed with the next one. (This particular error case seems to have been fixed since the hack was added, though.) This might lose frames if decoding returns errors during draining.
* avcodec/videotoolbox: set kCVPixelBufferOpenGLESCompatibilityKey for iOSwang-bin2017-03-06
| | | | | kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in iOS
* avcodec/wavpack: Fix runtime error: left shift of negative value -2Michael Niedermayer2017-03-05
| | | | | | | Fixes: 723/clusterfuzz-testcase-6471394663596032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dcadsp: Fix 2 runtime error: signed integer overflow: -1958094138 - ↵Michael Niedermayer2017-03-05
| | | | | | | | | 1078906344 cannot be represented in type 'int' Fixes: 722/clusterfuzz-testcase-5711268868521984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check bitrate_acc for overflowMichael Niedermayer2017-03-05
| | | | | | | Fixes: undefined behavior in 717/clusterfuzz-testcase-5434924129583104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 134527392 ↵Michael Niedermayer2017-03-05
| | | | | | | | | | * 16 cannot be represented in type 'int' This checks the sprite delta intermediates for overflow Fixes: 716/clusterfuzz-testcase-4890287480504320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13Michael Niedermayer2017-03-04
| | | | | | | Fixes: 709/clusterfuzz-testcase-4789836449841152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_mvpred: Fix multiple runtime error: left shift of negative valueMichael Niedermayer2017-03-04
| | | | | | | Fixes: 710/clusterfuzz-testcase-5091051431788544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/adxdec: Fix runtime error: left shift of negative value -1Michael Niedermayer2017-03-04
| | | | | | | Fixes: 705/clusterfuzz-testcase-5129572590813184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Improve the overflow checks in ↵Michael Niedermayer2017-03-04
| | | | | | | | | | | mpeg4_decode_sprite_trajectory() Also clear the state on errors Fixes integer overflows in 701/clusterfuzz-testcase-6594719951880192 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp56: Require a correctly decoded frame before using vp56_conceal_mb()Michael Niedermayer2017-03-04
| | | | | | | | Fixes timeout with 700/clusterfuzz-testcase-5660909504561152 Fixes timeout with 702/clusterfuzz-testcase-4553541576294400 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp3: Do not return random positive values but the buf sizeMichael Niedermayer2017-03-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* omx: Add support for specifying H.264 profile [v5']Takayuki 'January June' Suwa2017-03-03
| | | | | | This adds "-profile[:v] profile_name"-style option. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/scpr: fix top left prediction for special case when x is 0 for keyframesPaul B Mahol2017-03-03
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/interplayvideo: Fix timeout from lack of bitstream end checkMichael Niedermayer2017-03-03
| | | | | | | Fixes: 697/clusterfuzz-testcase-6111250582863872 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegaudiodec_template: Fix runtime error: signed integer overflow: ↵Michael Niedermayer2017-03-03
| | | | | | | | | 2053224902 + 2053224902 cannot be represented in type 'int' Fixes: 696/clusterfuzz-testcase-5853632270434304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mjpegdec: Fix runtime error: left shift of negative value -511Michael Niedermayer2017-03-03
| | | | | | | Fixes: 693/clusterfuzz-testcase-6109776066904064 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/sheervideo: Fix Y prediction for interlaced frames with transparency.Carl Eugen Hoyos2017-03-02
| | | | | Based on 260de8a2 by Paul B Mahol. Fixes ticket #6210.
* avcodec: add ClearVideo decoderKostya Shishkov2017-03-02
| | | | | | Only I-frames are decoded for now. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKeywm42017-03-02
| | | | | Makes sure the output can be mapped as OpenGL texture. This is what at least video players normally want.
* avcodec/videotoolbox: allow not setting the kCVPixelBufferPixelFormatTypeKeywm42017-03-02
| | | | | | | | | | | If AVVideotoolboxContext.cv_pix_fmt_type is set to 0, don't set the kCVPixelBufferPixelFormatTypeKey value on the VT decoder. This makes VT output its native format, which can be much faster on some hardware iterations (if the native format does not match with the requested format, it will be converted, which is slow). The default is still forcing nv12.
* avcodec, avutil, avformat: remove AVOption requirement for some fieldswm42017-03-02
| | | | | | | | | | Allow all struct fields to be accessed directly, as long as they're public. Before this change, many fields were "public", but could be accessed via AVOption only. This meant they were effectively not public, but were present for documentation purposes, which was incredibly confusing at best.
* avcodec/vp56: Clear dimensions in case of failure in the middle of a ↵Michael Niedermayer2017-03-02
| | | | | | | | | | | resolution change Similar code is used elsewhere in vp56 to force a more complete reinit in the future. Fixes null pointer dereference Fixes: 707/clusterfuzz-testcase-4717453097566208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpack: Check value before shift in wp_exp2()Michael Niedermayer2017-03-02
| | | | | | | | | | Fixes undefined shift, all callers should be changed to check the value they use with wp_exp2() or its return value. Fixes: 692/clusterfuzz-testcase-5757381516460032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ituh263dec: Use 0xffff as error code in h263p_decode_umotion()Michael Niedermayer2017-03-02
| | | | | | | | | This matches ff_h263_decode_motion() both functions error codes are interpreted by the same common code Fixes: 690/clusterfuzz-testcase-4744944981901312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264idct_template: Fix several runtime error: signed integer overflowMichael Niedermayer2017-03-02
| | | | | | | Fixes: 689/clusterfuzz-testcase-6029352737177600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/videotoolboxenc: fix symbol linkingRick Kern2017-03-01
| | | | | | Removes explicit reference to symbols and fixes dereferencing issue. Signed-off-by: Rick Kern <kernrj@gmail.com>
* avcodec/vp8: Check for bitsteam end in decode_mb_row_no_filter()Michael Niedermayer2017-03-01
| | | | | | | | | | | Fixes timeout with 686/clusterfuzz-testcase-5853946876788736 this shortcuts (i.e. speeds up) the error and return-to-user when decoding a truncated frame Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Previous version reviewed by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_direct: Fix runtime error: left shift of negative value -14Michael Niedermayer2017-03-01
| | | | | | | Fixes: 682/clusterfuzz-testcase-4799120021651456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()Michael Niedermayer2017-03-01
| | | | | | | | Fixes timeout Fixes: 501/clusterfuzz-testcase-5672752870588416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/nvenc: add initial QP value optionsKonda Raju2017-03-01
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: remove qmin and qmax constraints for vbrGanapathy Raman Kasi2017-03-01
| | | | | | | qmin and qmax are not necessary for nvenc vbr. Enforcing this constraint, doesn't allow user to use vbr 2 pass mode without explicity setting the qmin and qmax options Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/vp56: Factorize vp56_render_mb() outMichael Niedermayer2017-02-28
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dca: Fix multiple runtime error: signed integer overflowMichael Niedermayer2017-02-28
| | | | | | | | Fixes: 680/clusterfuzz-testcase-5416627266912256 Fixes: 681/clusterfuzz-testcase-5013323462475776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pictordec: Check plane value before doing value/mask computationsMichael Niedermayer2017-02-28
| | | | | | | | Fixes integer overflow Fixes: 675/clusterfuzz-testcase-6722971232108544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650Michael Niedermayer2017-02-28
| | | | | | | Fixes: 674/clusterfuzz-testcase-6713275880308736 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264idct_template: Fix multiple runtime error: signed integer overflowMichael Niedermayer2017-02-28
| | | | | | | | Fixes: 677/clusterfuzz-testcase-6635120628858880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>