summaryrefslogtreecommitdiff
path: root/libavformat/vividas.c
Commit message (Collapse)AuthorAge
* vividas: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/avio: Move internal AVIOContext fields to avio_internal.hAndreas Rheinhardt2021-08-25
| | | | | | | | | | | | | | Currently AVIOContext's private fields are all over AVIOContext. This commit moves them into a new structure in avio_internal.h instead. Said structure contains the public AVIOContext as its first element in order to avoid having to allocate a separate AVIOContextInternal which is costly for those use cases where one just wants to access an already existing buffer via the AVIOContext-API. For these cases ffio_init_context() can't fail and always returned zero, which was typically not checked. Therefore it has been made to not return anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vividas: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-08
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/vividas: Fix crash when seeking without audio streamAndreas Rheinhardt2021-04-02
| | | | | | | The current code tries the access the codecpar of a nonexistent audio stream when seeking. Stop that. Fixes ticket #9121. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/vividas: Use equals check with n in read_sb_block()Michael Niedermayer2021-03-28
| | | | | | | | Fixes: OOM Fixes: 27780/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5097985075314688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check number of audio channelsMichael Niedermayer2021-01-05
| | | | | | | | Fixes: division by 0 Fixes: 28597/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5752201490333696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check sample_rateMichael Niedermayer2020-12-09
| | | | | | | | | Fixes: Assertion c > 0 failed at libavutil/mathematics.c Fixes: 27001/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5726041328582656 Fixes: 27453/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5716060384526336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Make len signedMichael Niedermayer2020-12-09
| | | | | | | | Fixes: out of array access Fixes: 27424/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5682070692823040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: improve extradata packing checks in track_header()Michael Niedermayer2020-11-04
| | | | | | | | Fixes: out of array accesses Fixes: 26622/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6581200338288640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: better check of current_sb_entryMichael Niedermayer2020-10-30
| | | | | | | | | | | This is the simplest fix for the problem, it is possible to instead check this when the variables are set and propagate errors and then fail earlier Fixes: out of array access Fixes: 26490/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5723367078100992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas use avpriv_set_pts_info()Michael Niedermayer2020-10-30
| | | | | | | | | Fixes: assertion failure Fixes: 26482/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-4905102324006912 Fixes: 26491/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6002953141616640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check for zero v_sizeMichael Niedermayer2020-10-23
| | | | | | | | | Fixes: SEGV on unknown address 0x000000000000 Fixes: 26482/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-4905102324006912 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc, lavf: Remove newlines from calls to avpriv_request_sample().Carl Eugen Hoyos2020-10-11
|
* avformat/vividas: Check for EOF in first loop in track_header()Michael Niedermayer2020-09-21
| | | | | | | | | Fixes: timeout (243sec -> a few ms) Fixes: 25716/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5764093666131968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check allocation for successAndreas Rheinhardt2020-08-09
| | | | | Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/vividas: Check return value before storing it in smaller typeAndreas Rheinhardt2020-08-09
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/vividas: simplify, use av_rescale_q() insteadLimin Wang2020-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | note it'll cause a small difference in accuracy for the pts, please see the testing result below: $ wget http://samples.ffmpeg.org/archive/all/unknown+unknown+unknown+unknown+5029_paramount_en_1250.viv $ ./ffmpeg -t 0.04 -i ./unknown+unknown+unknown+unknown+5029_paramount_en_1250.viv -f null - old: pts: 522 pts: 1044 pts: 1567 pts: 3918 pts: 8097 pts: 12277 pts: 16457 ... new: pts: 522 pts: 1045 pts: 1567 pts: 3918 pts: 8098 pts: 12278 pts: 16457 ... Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: Forward errors where possibleAndreas Rheinhardt2019-12-12
| | | | | | | | | | It is not uncommon to find code where the caller thinks to know better what the return value should be than the callee. E.g. something like "if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit changes several instances of this to instead forward the actual error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/vividas: check avformat_new_stream() returnJun Zhao2019-11-29
| | | | | | | check avformat_new_stream() return. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/vividas: Avoid allocation of AVIOContextAndreas Rheinhardt2019-11-29
| | | | | | | | | | Put an AVIOContext whose lifetime doesn't extend beyond the function where it is allocated on the stack instead of allocating and freeing it. This also avoids the need to free it, which in this case fixes possible memleaks on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Error out on audio packets in the absence of audio streamsMichael Niedermayer2019-11-25
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check and require 1 video streamMichael Niedermayer2019-11-25
| | | | | | | | | | | The decoder hardcodes that audio is stream_id = 1 so it does not currently work with more or less than 1 video stream at st=0 Fixes: assertion failure Fixes: 18602/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6259277199310848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Add EOF check in val_1 loop in track_header()Michael Niedermayer2019-11-20
| | | | | | | | Fixes: Timeout (148sec -> 0.1sec) Fixes: 18427/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5682124627116032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix n_sb_blocks CheckMichael Niedermayer2019-11-09
| | | | | | | | Fixes: signed integer overflow: 1540265776 * 2 cannot be represented in type 'int' Fixes: 18160/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758808818712576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Test size and packet numbers a bit moreMichael Niedermayer2019-09-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check n_sb_blocks against input spaceMichael Niedermayer2019-09-24
| | | | | | | | Fixes: OOM Fixes: 16726/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5719320750981120 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Remove align offset which is always masked offMichael Niedermayer2019-09-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: remove dead assignmentMichael Niedermayer2019-09-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: check for tiny blocks using alignmentMichael Niedermayer2019-09-06
| | | | | | | | | Ask for a sample for these Fixes: out of array access Fixes: 16624/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5762455661182976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check av_xiphlacing() return value before useMichael Niedermayer2019-08-22
| | | | | | | | | Fixes: out of array access Fixes: 16277/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5696629440512000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix another infinite loopMichael Niedermayer2019-08-11
| | | | | | | Not found by the fuzzer Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix infinite loop in header parserMichael Niedermayer2019-08-11
| | | | | | | | | Fixes: Timeout (Infinite -> Finite) Fixes: 16010/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5638616102993920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix memleak of AVIOContext in track_header()Michael Niedermayer2019-08-05
| | | | | | | | Fixes: memleak Fixes: 16127/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5649290914955264 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check that value from ffio_read_varlen() does not overflowMichael Niedermayer2019-08-03
| | | | | | | | Fixes: signed integer overflow: -1241665686 + -1340629419 cannot be represented in type 'int' Fixes: 15922/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5692826442006528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: forward errors from track_header()Michael Niedermayer2019-08-03
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check buffer size before allocationMichael Niedermayer2019-08-03
| | | | | | | | Fixes: out of array access Fixes: 15365/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5716153105645568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check if extradata was read successfullyMichael Niedermayer2019-08-03
| | | | | | | | Fixes: OOM Fixes: 15575/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5654666781655040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fixes overflow in shift in recover_key()Michael Niedermayer2019-07-14
| | | | | | | | | | Fixes: left shift of 133 by 24 places cannot be represented in type 'int' Fixes: 15365/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5716153105645568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check for input length in get_v()Michael Niedermayer2019-07-08
| | | | | | | | Fixes: out of array read Fixes: 15286/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5658245101780992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: check length in read_vblock()Michael Niedermayer2019-06-25
| | | | | | | | Fixes: out of array access Fixes: 15166/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5731062396747776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: reduce keybits to require half the spaceMichael Niedermayer2019-06-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix invalid shift in decode_key()Michael Niedermayer2019-06-21
| | | | | | | | Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 15118/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5740230004441088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* lavf/vividas: Support demuxing on big-endian hardware.Carl Eugen Hoyos2018-12-28
|
* lavf/vividas: Do not increase extradata_size after allocation.Carl Eugen Hoyos2018-12-28
| | | | Avoids a crash in avcodec_parameters_from_context().
* avformat/vividas: check if viv->sb_pb is not NULLPaul B Mahol2018-12-22
|
* avformat/vividas: check if size is enough big in xor_blockPaul B Mahol2018-12-22
|
* avformat/vividas: fix undefined behaviourPaul B Mahol2018-12-22
|
* avformat/vividas: check if value from ffio_read_varlen() is too bigPaul B Mahol2018-12-22
|