summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/omx: fix xFramerate calculationAman Gupta2019-09-02
| | | | | | | | | | | Integer overflow in the Q16 framerate calculation was sending invalid values to the OMX encoder. On the RPI4, this manifested as bitrate controls being ignored on video streams with 60000/1001 framerates. Video streams with 30000/1001 framerates were not affected. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avformat/mpegtsenc: fix flushing of audio packetsMarton Balint2019-09-02
| | | | | | | | | | | | | | | | | | | | | | | | 7d097a0fc57f0fa8385962a539c657c2f40b5ed0 had the same purpose as 3700f655c55e2001b57215210b957b169d66b50f but the former is much simpler, so let's remove the latter. Unfortunately both checks were wrong, because in order to make sure DTS > PCR we have to give us some headroom, so instead of using a dts_difference < max_delay check let's use a dts_difference < max_delay/2 check. Fixes DTS < PCR errors with this command line: ./ffmpeg -loglevel verbose -y -f lavfi -i \ "testsrc=s=64x64:d=20,split=2[out0][tmp1];[tmp1]vflip[out1];sine=d=20,asetnsamples=1000[out2]" \ -flags +bitexact -fflags +bitexact -sws_flags +accurate_rnd+bitexact \ -codec:v libx264 -codec:a mp2 -b:a 32k -pix_fmt yuv420p \ -map '0:v:0' \ -map '0:v:1' \ -map '0:a:0' \ -muxrate 800000 \ -program st=0:st=2 -program st=1:st=2 -program st=2 -program st=0 -f mpegts out1.ts Signed-off-by: Marton Balint <cus@passwd.hu>
* docs/formats: fix max_interleave_delta defaultMarton Balint2019-09-02
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/ralf: fix undefined shift in extend_code()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: left shift of negative value -3 Fixes: 16147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5658392722407424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ralf: fix undefined shiftMichael Niedermayer2019-09-02
| | | | | | | | Fixes: left shift of negative value -2 Fixes: 16145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5146671058518016 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngdec: Optimize has_trns codeMichael Niedermayer2019-09-02
| | | | | | | | | | | | | add inner loop specialisations for 2 bpp and 4 bpp These are all cases for which i found testsamples. 30M cycles -> 5M cycles Testcase: fate-rgbapng-4816 Testcase: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vcodec/apedec: Fix integer overflow in filter_3800()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: signed integer overflow: 2021654528 + 2032575680 cannot be represented in type 'int' Fixes: 16270/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5732438816325632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/apedec: Fix integer overflow in filter_fast_3320()Michael Niedermayer2019-09-02
| | | | | | | | Fixes: signed integer overflow: -1094994793 * 2 cannot be represented in type 'int' Fixes: 16139/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5663911036059648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/v4l2_m2m: don't close the file descriptor we don't ownPavel Koshevoy2019-09-02
| | | | | | | | | ff_v4l2_m2m_create_context initialized V4L2m2mContext.fd to 0 which is a valid file descriptor value. Next ff_v4l2_m2m_codec_init failed and v4l2_m2m_destroy_context closed file descriptor 0 even though it didn't belong to V4L2m2mContext. Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
* configure: Update libmysofa check with a new symbol.Andrey Semashev2019-09-02
| | | | | | | | The current code in libavfilter/af_sofalizer.c requires mysofa_neighborhood_init_withstepdefine function, which only appeared in libmysofa 0.7. Use this function in configure script to bail out early if a too old libmysofa is found in the system instead of failing at compile time.
* avcodec/bgmc: Check input space in ff_bgmc_decode_init()Michael Niedermayer2019-09-02
| | | | | | | | | Fixes: Infinite loop Fixes: 16608/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5636229827133440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks()Michael Niedermayer2019-09-02
| | | | | | | | | Fixes: Timeout (82sec -> 1sec) Fixes: 16411/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-5166958151991296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_v360: remove not needed items from ThreadDataPaul B Mahol2019-09-02
|
* avfilter/vf_delogo: unbreak fatePaul B Mahol2019-09-02
| | | | | | | | | It is not clear what was real intention of previous commit to this filter. It was not working correctly, hopefully this is fixed now. It never checked that new x/y/w/h are actually valid, hopeffully this is fixed now. It uses named variables in expressions that are never set, still not fixed. It does not set named variables that uses actual frame widht/height, making actual expressions less usable for our users, still now fixed.
* avfilter/vf_v360: set much smaller limit to w/hPaul B Mahol2019-09-02
|
* avfilter/vf_v360: fix some small code style issuesPaul B Mahol2019-09-02
|
* avfilter/vf_v360: extend description of eac formatPaul B Mahol2019-09-02
|
* avfilter/vf_v360: rename fb format to barrelPaul B Mahol2019-09-02
|
* avcodec/tiff: rewrite lut handlingPaul B Mahol2019-09-02
| | | | Remove endianess hack.
* avcodec/tiff: set color_trc, remove sRGB conversionPaul B Mahol2019-09-02
|
* lavc/tiff: Enable decoding of LinearRaw imagesNick Renieris2019-09-02
| | | | | | | | | | | | | "LinearRaw" is a value that the PhotometricInterpretation tag can be set to on DNG images that contain color information for all channels instead of being bayer-encoded ("CFA" value). The DNG decoder is complete enough that we can enable this now. Sample: - http://www.rawsamples.ch/raws/nikon/SCANNER_NIKON_LS5000.DNG Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Default-initialize WhiteLevel DNG tag valueNick Renieris2019-09-02
| | | | | | | | | | | Initialized to `(2 ^ BitsPerSample) - 1` as per the DNG Specification. Also make sure that `BlackLevel < WhiteLevel`. This fixes decoding for "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Support DNGs with striped (non-tiled) JPEGs imagesNick Renieris2019-09-02
| | | | | | | DNG samples here can now be decoded: - https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Skip unknown APPx marker on bayer imagesNick Renieris2019-09-02
| | | | | | | | Samples: - Embedded JPEG images in the DNG images here: https://www.photographyblog.com/previews/pentax_k1_photos Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Decode 10-bit and 14-bit DNG imagesNick Renieris2019-09-02
| | | | | | | 10-bit sample: http://www.rawsamples.ch/raws/phones/RAW_ONEPLUS_ONE-A0001.DNG 14-bit sample: https://drive.google.com/open?id=0B4JyRT3Lth5HVndyOTVOdWktM3J4TFEydTk1MnY3RWlpSzVB Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Support decoding of DNGs with single-component JPEGsNick Renieris2019-09-02
| | | | | | | | This enables decoding of DNG images generated by the 'DJI Zenmuse X7' digital camera Samples: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Enable decoding of single-component bayer imagesNick Renieris2019-09-02
| | | | | | | | | Also, ensure no false positives when determining DNG bayer images, by setting them in tiff.c instead of relying on a heuristic. There's no way to determine this just from the JPEG data, so we have to pass this information from outside the MJPEG decoder. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Force DNG pixel data endianness on an edge caseNick Renieris2019-09-02
| | | | | | | This fixes "X7 RAW" and "X7 CinemaDNG" samples here: - https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Don't apply strips-related logic to tiled imagesNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Fix edge case with full-length/width tilesNick Renieris2019-09-02
| | | | | | | | | When the height is equal to the tile length (full-height tile) after `height % tile_length` is applied with the current code, it results in the operating tile_length to be 0. This commit makes this leftover logic only applies if it's necessary. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/jpegtables: Handle multiple mappings to the same valueNick Renieris2019-09-02
| | | | | | | | | | | | | | | | | | | Some JPEGs [1] have incorrect DHT entries that map 2 codes to the same value. The second (last) mapping does not ever actually appear in the code stream, therefore ignoring any mappings after the first one fixes this. Without this, an "mjpeg_decode_dc: bad vlc: 0:0" error is thrown. In all known files, the 2 codes are mapped to symbol 0 so only that case is checked. [1]: Embedded JPEGs in "X7 RAW" and "X7 CinemaDNG" samples here: https://www.dji.com/gr/zenmuse-x7/info#downloads Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Apply color scaling to uncompressed DNGsNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Convert DNGs to sRGB color spaceNick Renieris2019-09-02
| | | | Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/tiff: Decode embedded JPEGs in DNG imagesNick Renieris2019-09-02
| | | | | | | | | | | | | | | | Used a technique similar to lavc/tdsc.c for invoking the MJPEG decoder. This commit adds support for: - DNG tiles - DNG tile huffman lossless JPEG decoding - DNG 8-bpp ("packed" as dcraw calls it) decoding - DNG color scaling [1] - LinearizationTable tag - BlackLevel tag [1]: As specified in the DNG Specification - Chapter 5 Signed-off-by: Nick Renieris <velocityra@gmail.com>
* lavc/mjpegdec: Decode Huffman-coded lossless JPEGs embedded in DNGsNick Renieris2019-09-02
| | | | | | | | | | | Main image data in DNGs is usually comprised of tiles, each of which is a Huffman-encoded lossless JPEG. Tested for ljpeg regressions with: `ffmpeg -f lavfi -i testsrc=d=1 -vcodec ljpeg test.avi` `ffmpeg test.avi out.avi` The modified code in ljpeg_decode_rgb_scan runs without issues. Signed-off-by: Nick Renieris <velocityra@gmail.com>
* avformat/dashdec: start from the root uri when baseURL is start with '/'Steven Liu2019-09-02
| | | | | | fix ticket: 8097 Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avfilter/vf_delogo: support expr in delogo filterSteven Liu2019-09-02
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hlsenc: refine the get_relative_url function to avoid extra malloc for ↵Limin Wang2019-09-02
| | | | | | | relation path Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: Support EBU Tech. 3213-E primaries valuesRaphaël Zumer2019-09-01
| | | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter: Support EBU Tech. 3213-E primaries valuesRaphaël Zumer2019-09-01
| | | | | Signed-off-by: Raphaël Zumer <rzumer@tebako.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/pixfmt: Add EBU Tech. 3213-E AVColorPrimaries valueRaphaël Zumer2019-09-01
| | | | | | | | | | This is an alias for JEDEC P22. The name associated with the value is also changed from jedec-p22 to ebu3213 to match ITU-T H.273. Signed-off-by: Raphaël Zumer <rzumer@tebako.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block()Michael Niedermayer2019-08-31
| | | | | | | | Fixes: signed integer overflow: 1795032576 + 598344192 cannot be represented in type 'int' Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5636723419119616 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 pixel threshold for TRUEMOTION2, as it ↵Michael Niedermayer2019-08-31
| | | | | | | | | | allows coding gigantic images on tiny input Fixes: Timeout (137sec -> 6sec) Fixes: 16090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5674245178261504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_block: Check the return code from vc1_decode_p_block()Michael Niedermayer2019-08-31
| | | | | | | | | Fixes: left shift of negative value -1 Fixes: 16424/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-5656579055026176 Fixes: 16358/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5714436358144000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1dec: Require res_sprite for wmv3imagesMichael Niedermayer2019-08-31
| | | | | | | | | | | non res_sprite leads to decoder delay which leads to assertion failure Fixes: Assertion failure Fixes: 16402/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5704510034411520 Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int' Fixes: 16425/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5692858838810624 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_block: Check for double escapesMichael Niedermayer2019-08-31
| | | | | | | | Fixes: out of array read Fixes: 16331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3IMAGE_fuzzer-5672735195267072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mathematics: Fix 2 overflows in av_add_stable()Michael Niedermayer2019-08-31
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Fixes: 16022/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5759796759756800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: return pending IO error on EOF in av_read_frame()Marton Balint2019-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | avio_feof() returns true both in case of actual EOF and in case of IO errors. Some demuxers (matroska) have special handling to be able to return the proper error for this exact reason, e.g.: if (avio_feof(pb)) { if (pb->error) { return pb->error; } else { return AVERROR_EOF; } } However, most of the demuxers do not, and they simply return AVERROR_EOF if avio_feof() is true, so there is a real chance that IO errors are mistaken for EOF. We might just say that the API user should always check the IO context error attribute on EOF to make sure no IO errors happened, but not even ffmpeg.c does this. It should be more intuitive to the API user if we simply return the IO error as the return value of av_read_frame() instead of AVERROR_EOF. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/avidec: add support for recognizing HEVC fourcc when demuxingMarton Balint2019-08-31
| | | | | | | | | | | Some security cams generate this, as well as some versions of VirtualDub and VLC so support for _reading_ such files is justified. Fixes ticket #7110. See also this discussion: https://patchwork.ffmpeg.org/patch/8744/ Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegts: fix teletext PTS when selecting teletext streams onlyMarton Balint2019-08-31
| | | | | | | | | | | | | | | After a1b4f120c031e6697bac9fd8c725d9c37ee36d13 the teletext PTS values were set to AV_NOPTS_VALUE if the stream of the PCR pid was discarded. What actually matters is that if we parse the PCR of the PCR PID or not, so let's use the cached discard value of the actual PCR PID instead of the stream discard value, which may be different. Also fixes ticket #7567, which was caused by the fact that teletext PTS values were not touched if the PCR pid was discarded even before a1b4f120c031e6697bac9fd8c725d9c37ee36d13. Signed-off-by: Marton Balint <cus@passwd.hu>