summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/utils: change AVStream side data related public function and struct ↵James Almer2021-03-10
| | | | | | | | | size types to size_t av_stream_add_side_data() already defines size as a size_t, so this makes it consistent across all side data functions. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/packet: change side data related public function and struct size ↵James Almer2021-03-10
| | | | | | | | | types to size_t av_packet_add_side_data() already defines size as a size_t, so this makes it consistent across all side data functions Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: change av_frame_new_side_data() size parameter type to size_tJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: change public function and struct size parameter types to size_tJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/af_dynaudnorm: make better check for available samplesPaul B Mahol2021-03-10
| | | | Also report more correct EOF timestamp.
* avfilter/vf_nnedi: Fix use of uninitialized valueAndreas Rheinhardt2021-03-10
| | | | | | | Fixes Coverity issue #1473546. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* fftools/ffplay: do not write out of rdft visualization textureMarton Balint2021-03-10
| | | | | | | | | | | | If the window is resized it was possible that xpos pointed outside the visualization texture. By rearranging the overflow check we make sure this (and a crash) does not happen. We also don't have to use xleft for start position, as that is 0 anyways, and if we ever want to take into account xleft then the texture should be positioned accordingly when rendering. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/mediacodec_wrapper: use MediaCodecInfo.isSoftwareOnly() when availablesfan52021-03-10
| | | | | Added in Android 10 it provides a reliable way of filtering out software decoders, unlike existing string-based checks.
* avcodec/mediacodec_wrapper: check if codec is software earliersfan52021-03-10
|
* avformat/mvdec: Allocate extradata only onceMichael Niedermayer2021-03-09
| | | | | | | | Fixes: memleak Fixes: 28686/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5822961932173312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/amfenc_hevc: Recommend values for min and max video quantizer scale.Ovchinnikov Dmitrii2021-03-09
| | | | | | | Current settings makes bitrate larger than expected, more information: https://github.com/HandBrake/HandBrake/issues/3447#issue-820490736 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/decode: Reindent after previous commitsAndreas Rheinhardt2021-03-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: Don't needlessly copy side-data for subtitlesAndreas Rheinhardt2021-03-09
| | | | | | | | AVCodecInternal.last_pkt_props is not used when decoding subtitles; ergo it makes no sense to set it at all. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/decode: Avoid stack packets when decoding subtitlesAndreas Rheinhardt2021-03-09
| | | | | | | | | | | | | Use AVCodecInternal.buffer_pkt (previously only used in avcodec_send_packet) instead of stack packets when decoding subtitles. Also stop sharing side-data between packets and use the user-supplied packet directly for decoding when possible (no subtitle decoder ever modifies the packet it is given). Reusing AVCodecInternal.buffer_pkt is based upon an idea from James Almer. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/qsvdec: Make functions used only here static, remove headerAndreas Rheinhardt2021-03-09
| | | | | | | | | Forgotten after d78ecf10bd745cb69a71b32419e0661bfdcfb1fd. (Also mark some AVPackets as const.) Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify some AVPacketsAndreas Rheinhardt2021-03-09
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* mailmap: add entry for myselfLinjie Fu2021-03-09
| | | | Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
* avcodec/dcadsp: Fix integer overflow in dmix_add_c()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: signed integer overflow: 1515225320 + 759416059 cannot be represented in type 'int' Fixes: 29256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzzer-5719088561258496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvdec: Check double before cast in parse_keyframes_index()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: -2.21166e+304 is outside the range of representable values of type 'long' Fixes: 29169/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5725452796821504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/paf: Check for EOF before allocation in read_header()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: OOM Fixes: 26584/clusterfuzz-testcase-minimized-ffmpeg_dem_PAF_fuzzer-5172661183053824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* tools/target_dec_fuzzer: Adjust flv1 thresholdMichael Niedermayer2021-03-08
| | | | | | | | Fixes: Timeout (long -> 95ms) Fixes: 29068/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLV_fuzzer-6509662832820224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Avoid undefined negation in imdct_and_windowing_eld()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'INTFLOAT' (aka 'int'); cast to an unsigned type to negate this value to itself Fixes: 29057/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5642758933053440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/swfdec: Check outlen before allocationMichael Niedermayer2021-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: Timeout (too long -> 241ms) Fixes: 29083/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-6273684478230528 The source of the magic number is A very quick simulation of the best case compression for "compress" below is not nice written code as i did not expect I or anyone else would ever see it again I would have preferred some nicer expression or course, but thats what it seems to be asymptotically. For smaller amounts of data a tighter bound is possible but i saw no nice way to consider that and it seems also overkill to try to do it more fine grained for just this main(){ int64_t bits = 0; int bank = 256; int bitbank = 8; for(unsigned i = 0; i<1024*1024*1024*4U-100000;) { int word_size = bank-255; i += word_size; bits += bitbank; if (!(bank & (bank-1))) bitbank ++; bank++; if (bitbank > 16) { printf("BEST %f \n", 8.0 * i / bits ); bank = 256; bitbank = 8; } } } above assumes i remembered correctly how the algorithm works but the value was close to what actual compession of zeros gave 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: add forgotten flags to mpeg4_optionsPaul B Mahol2021-03-08
|
* mobiclip: fix copyright headersFlorian Nouwt2021-03-08
| | | | | | | | The Mobiclip related code was based on Mobius (https://github.com/adibsurani/Mobius), which was based on my original reverse engineering efforts (https://github.com/Gericom/MobiclipDecoder). This commit adds the appropriate copyright headers on the related files. Signed-off-by: Florian Nouwt <fnouwt2@gmail.com>
* avcodec/ylc: Reindent after previous commitAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Avoid code duplication when creating and freeing VLCsAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Use only one temporary bufferAndreas Rheinhardt2021-03-08
| | | | | | | | | The effective lifetime of the buffer used to build the VLCs and the buffer containing the bitstream is disjoint, so that one can use a common buffer for both. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ylc: Remove write-only variableAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/h261dec: Remove parse_context cruftAndreas Rheinhardt2021-03-08
| | | | | | | | The H.261 decoder doesn't use the ParseContext of its MpegEncContext since e7316976650b429345da619c3acff38004aaf6b8. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: clarify thread_safe_callbacks doxyAnton Khirnov2021-03-08
| | | | | State explicitly when this field will be removed and how to access it in a forward compatible way.
* lscrdec: add copyright headerAnton Khirnov2021-03-08
| | | | As requested by the author.
* lavc: remove tests/optionsAnton Khirnov2021-03-08
| | | | It tests deprecated avcodec_copy_context().
* tests/api-flac-test: reindentAnton Khirnov2021-03-08
|
* tests/api-flac-test: convert to new encoding/decoding APIAnton Khirnov2021-03-08
|
* tests/api-flac-test: ensure the frame is writable before writing to itAnton Khirnov2021-03-08
| | | | | The encoder may keep a reference to frames that were sent to it, so the caller cannot modify them without checking first.
* mjpegdec: handle lowres with AVID croppingAnton Khirnov2021-03-08
|
* avcodec/jpeglsenc: Allocate buffers togetherAndreas Rheinhardt2021-03-08
| | | | | | | | | Having only one allocation that is not automatically freed in particular means that one does not need to free the already allocated buffers when allocating another one fails. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Avoid allocation of JLSStateAndreas Rheinhardt2021-03-08
| | | | | | | | This state is currently allocated and freed for every packet; but it can just be moved to the stack instead. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Only use one line at a time as spare bufferAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | | ls_encode_line() encodes one line of input from left to right and to do so it uses the values of the left, upper left, upper and upper right pixels for prediction (i.e. the values that a decoder gets when it decodes the already encoded part of the picture). So a simple algorithm would use a buffer that can hold two lines, namely the current line as well as the last line and swap the pointers to the two lines after decoding each line. Yet if one is currently encoding the pixel with index k of a line, one doesn't need any pixel with index < k - 1 of the last line at all and similarly, no pixels with index >= k have been written yet. So the overlap in the effective lifetime is pretty limited and since the last patch (which stopped reading the upper left pixel and instead reused the value of the upper pixel from the last iteration of the loop) it is inexistent. Ergo one only needs one line and doesn't need to swap the lines out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Move check out of loopAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | ls_encode_line() encodes a line of input, going from left to right. In order to calculate a predicted value it uses the left and upper-left value of the output picture (that is, it uses how a decoder would see the already encoded part of the picture), unless this is the very first pixel of this line in which case one uses the first pixel of the last (upper) line and the line before the last line. Therefore the loop contained a check for whether this is the beginning of a new line. This commit moves said check out of the loop by initializing these values before the loop and by updating these values at the end of the loop body; already read/calculated values are reused for this (the prediction also needs the value of the upper pixel and this can be reused for the upper left value of the next iteration of the loop). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Don't modify frame we don't ownAndreas Rheinhardt2021-03-08
| | | | | | | | | | | | | | | | | | | | | The jpegls encoder uses three buffers (as well as its state) to perform its function: A copy of the last encoded line as a decoder would decode it, the part of the current line that has been encoded (again, as a decoder would decode it) and the part of the current line that is not yet encoded. The encoder solves this by modifying the input frame as it encodes the output (it also zero-allocates a line to serve as last line for the first line where no preceding line exists); yet this is wrong as said frame is not owned by the encoder, so it must not be modified (and it is given to the encoder as const AVFrame *) without making it writable. This patch solves this bug by allocating two lines, one for the last and one for the currently encoded line of output (as a decoder would decode it). Notice that the frame is only modified if the encoder is in the non-default non-lossless mode. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeglsenc: Don't use put bits API for byte-aligned writesAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/codec: Update init_static_data doxygenAndreas Rheinhardt2021-03-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Don't suggest calling deprecated avcodec_register_all()Andreas Rheinhardt2021-03-08
| | | | | | | | | | | | Despite avcodec_register and avcodec_register_all being deprecated, their documentation still said that one of them has to be called before doing anything else. Clarify this confusing situation. Furthermore, don't use avcodec_register_all in sample code for a non-deprecated function. Reviewed-by: mypopy@gmail.com <mypopy@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Don't needlessly strdup metadataAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Remove limit on length of idAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/codec: add doxy to AVCodec.decode()James Almer2021-03-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec: use the correct name for all AVCodec.decode() parametersJames Almer2021-03-07
| | | | | | | This field hasn't been used to return the output frame size since avcodec_decode_audio4() was introduced. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/codec: remove outdated comment about AVCodec.encode2()James Almer2021-03-07
| | | | | | | The packet passed as argument to this function hasn't contained a user-provided buffer since 93016f5d1d. Signed-off-by: James Almer <jamrial@gmail.com>