Commit Graph

23397 Commits

Author SHA1 Message Date
Michael Niedermayer
f514113cfa avformat/flvdec: Treat high ts byte as unsigned
Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
Fixes: 27516/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5152854660349952

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 21:18:16 +01:00
Michael Niedermayer
0b78016b2d avformat/mov: Ignore tags with invalid size during probing
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 21:14:47 +01:00
Michael Niedermayer
1ad6801a61 avformat/mov: Factor offset advancement out in probing
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 21:14:47 +01:00
Michael Niedermayer
941e747d66 avformat/mov: simplify size code in probing a bit
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 21:14:47 +01:00
Michael Niedermayer
fec4a2d232 avformat/mov: Support size = 1 and size = 0 special cases in probing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 21:14:47 +01:00
Jan Ekström
752f14ff94 avformat/movenc: remove unnecessary HDR metadata log messages
These made sense before 3ebf449766
when the creation of these boxes was specifically requested by the
user, but now they have become unnecessary as they are just like
many other boxes: If the input has the information required, they
are written, otherwise they are not.

They were moved to verbose verbosity level (which happens to be
the last level still relatively usable), and now appear either once
(normal MP4 muxing), or thrice (with the faststart flag set) in
any normal MP4 usage, without giving much useful information. Thus,
remove them in their current form.
2021-02-10 21:35:21 +02:00
Michael Niedermayer
2014b01352 avformat/samidec: Sanity check pts
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 29743/clusterfuzz-testcase-minimized-ffmpeg_dem_SAMI_fuzzer-5499256859394048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:30 +01:00
Michael Niedermayer
a0ceb0cdd4 avformat/avidec: Use 64bit in get_duration()
Fixes: signed integer overflow: 2147483424 + 8224 cannot be represented in type 'int'
Fixes: 29619/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5191424373030912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:30 +01:00
Michael Niedermayer
658f0606cb avformat/mov: Check for duplicate st3d
Fixes: memleak
Fixes: 29585/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6594188688490496

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:30 +01:00
Michael Niedermayer
6c64351bb1 avformat/mvdec: Check for EOF in read_index()
Fixes: Timeout
Fixes: 29550/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5094307193290752

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:29 +01:00
Michael Niedermayer
25f240fcb3 avformat/id3v2: Check the return from avio_get_str()
Fixes: out of array access
Fixes: 29446/clusterfuzz-testcase-minimized-ffmpeg_dem_AAC_fuzzer-5096222622875648

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-10 12:28:29 +01:00
Paul B Mahol
e0fd35d867 avformat/fitsenc: write DATAMIN/DATAMAX to encoded output
There is no point in doing normalization when such files are decoded.

Update fate test with new results.
2021-02-10 00:03:38 +01:00
Michael Niedermayer
2c60eb6c5a avformat/mov: factor size out of probe code
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-09 19:37:27 +01:00
Michael Niedermayer
5552ceaf56 avformat/wtvdec: Check len in parse_chunks() to avoid overflow
Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int'
Fixes: 30084/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6192261941559296

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>
2021-02-09 19:37:27 +01:00
Michael Niedermayer
69754e07f5 avformat/wtvdec: Check for EOF before potentially reseting the eof state
Fixes: infinite loop
Fixes: 28042/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6311288967528448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-09 19:37:27 +01:00
Michael Niedermayer
2c8cd4490a avformat/asfdec_f: Add an additional check for the extradata size
Fixes: OOM
Fixes: 30066/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_fuzzer-6182309126602752

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>
2021-02-09 19:37:27 +01:00
Michael Niedermayer
7e5034f97e avformat/3dostr: Check sample_rate
Fixes: signed integer overflow: -1268324762623155200 * 8 cannot be represented in type 'long'
Fixes: 30123/clusterfuzz-testcase-minimized-ffmpeg_dem_THREEDOSTR_fuzzer-6710765123928064

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>
2021-02-09 19:37:27 +01:00
Marton Balint
cae57cae1f avformat/libsrt: fix race condition with libsrt_network_wait_fd and epoll
The way SRT's async / epoll-based IO works is that the event status is stored
in the epoll containers. That is, if an event occurs on an SRT socket, and that
SRT socket isn't part of any epoll container, then that event is lost. If we
later add that socket to an epoll container, we still won't receive the event
even if it wasn't serviced.

Therefore we create the epoll and put the fd into it right after the connection
is established.

See http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-January/275334.html

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-07 19:42:22 +01:00
Marton Balint
5cf01ed5cd avformat/libsrt: fix or simplify some function return values
Sometimes there was a confusion between srt_*() function return values and
libavformat-style return values.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-07 19:42:22 +01:00
Marton Balint
d4e4ffd348 avformat/libsrt: close listen fd immediately after accept
There is no reason to keep it open.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-07 19:42:22 +01:00
Paul B Mahol
e28b6e0448 avformat/img2dec: improve xbm probing 2021-02-05 22:37:34 +01:00
Paul B Mahol
6b8ef5119c avformat/cdxl: add back options to override sample and frame rate
It make sense to allow to control speed of playback when
no infomation is provided.
2021-02-05 18:11:42 +01:00
Paul B Mahol
84d5df5446 avformat: add xbm_pipe demuxer 2021-02-05 15:36:19 +01:00
Limin Wang
81c462ad95 avformat/mxfenc: prefer to use the configured metadata
The metadata company_name, product_name, product_version from input
file will be deleted to avoid overwriting information
Please to test with below commands:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
and
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \
        -metadata company_name="xxx" \
        -metadata product_name="xxx" \
        -metadata product_version="xxx" \
        out.mxf

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-02-05 09:27:06 +08:00
Limin Wang
9605307e78 avformat/mxf: add platform local tag
Please check the string of platform with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf
....
application_platform: Lavf (linux)

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-02-05 09:27:06 +08:00
Limin Wang
3f8db7eea0 avformat/mxfdec: set toolkit version metadata
Please check the string of toolkit version with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf
....
toolkit_version : 58.65.101.0.0

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-02-05 09:27:05 +08:00
Paul B Mahol
cba716f55e avformat/cdxl: improve frame rate guessing for standard cdxl
Use audio size and sample rate to get real frame rate.
Also make seeking more robust.
2021-02-05 00:43:11 +01:00
Michael Niedermayer
842c268c64 avformat/4xm: Make audio_frame_count 64bit
Fixes: signed integer overflow: 2099257366 * 2 cannot be represented in type 'int'
Fixes: 27486/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-5112179134824448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-04 23:34:29 +01:00
Michael Niedermayer
4f70e1ec0c avformat/mov: Use av_mul_q() to avoid integer overflows
Fixes: signed integer overflow: 538976288 * 538976288 cannot be represented in type 'int'
Fixes: 27473/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5758978289827840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-04 23:34:29 +01:00
Paul B Mahol
e955f5ac01 avformat: add binka demuxer 2021-02-04 17:52:45 +01:00
Michael Niedermayer
b12e713b80 avformat/rmdec: Reorder operations to avoid overflow
Fixes: signed integer overflow: -2147483648 - 14 cannot be represented in type 'int'
Fixes: 27659/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-5697250168406016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-04 17:26:07 +01:00
Michael Niedermayer
ab82c10578 avformat/mvdec: Sanity check SAMPLE_WIDTH
Fixes: signed integer overflow: 999999999 * 8 cannot be represented in type 'int'
Fixes: 30048/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5864289917337600

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>
2021-02-04 17:20:31 +01:00
sfan5
a44c42dc31 avformat/dashdec: Avoid segfault when URL template is unexpectedly missing
This isn't supposed to happen, but unfinished support for non-templated
manifests and lack of e.g. presentationTimeOffset handling can provoke
such a situation even with well-formed input.
2021-02-04 10:30:39 +08:00
sfan5
5a98a027d6 avformat/dashdec: Fix missing NULL check 2021-02-04 10:30:37 +08:00
Steven Liu
29ef547c16 avformat/dashdec: rename variable name for more readable
Rename is_init_section_common_audio to is_init_section_common_subtitle
for is_common_init_section_exist(c->subtitles, c->n_subtitles).
Because it is checked to subtitles, not audio.

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
2021-02-04 10:30:35 +08:00
Steven Liu
756897eff4 avformat/dashdec: check init_section before use it.
because there have no Initialization in SegmentTemplate,
so it will have no init_section for init segment file.
but in the is_common_init_section_exist function it will be used for
check to url, url_offset and size, so check init_section
before use init_section.
And fix code style in is_common_init_section_exist,
make the code block short when it too long.

fix ticket: 9062

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
2021-02-04 10:30:32 +08:00
Paul B Mahol
a8b3a51790 avformat/cdxl: rework probe and fix sample rate and frame rate 2021-02-04 00:57:49 +01:00
Andreas Rheinhardt
1873d128f9 avformat/qtpalette: Use better headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 22:28:11 +01:00
Andreas Rheinhardt
e9513052b5 avformat/rtsp: Fix build failure when RTP demuxers are disabled
rtsp.c uses a check of the form "if (CONFIG_RTSP_DEMUXER && ...) {}"
with the intent to make the code compilable even though the part guarded
by this check contains calls to functions that don't exist when the RTSP
demuxer is disabled. Yet even then compilers still need a declaration of
all the functions in the dead code block and error out if not (due to
our usage of -Werror=implicit-function-declaration) and no such
declaration exists for a static function in rtsp.c. Simply adding a
declaration leads to a "used but never defined" warning, therefore this
commit resorts to an #if.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:36:47 +01:00
Andreas Rheinhardt
7936cfc157 avformat/Makefile: Only compile qtpalette.c when needed
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:35:43 +01:00
Andreas Rheinhardt
d97e84b46f avformat/qtpalette: Move default palette to their only user
Namely qtpalette.c itself.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:35:43 +01:00
Andreas Rheinhardt
a703410d25 avformat/cutils, dvenc: Move ff_brktimegm to its only user
This also allows to completely remove cutils.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03 21:35:43 +01:00
Paul B Mahol
e818951505 avformat/cdxl: add support for custom 24bit pal8 formats
Also stop discarding half of audio samples and use planar pcm s8.
2021-02-03 19:11:35 +01:00
Tomas Härdin
e6254d5ab9 avformat/mxfdec: Add missing const to mxf_mastering_display* 2021-02-03 17:56:28 +01:00
Anton Khirnov
b7251aed46 av_dump_format(): reduce indentation for streams
Makes it easier to identify where metadata/chapters end and streams
begin.
2021-02-03 10:41:33 +01:00
Anton Khirnov
3696c3b161 av_dump_format(): increase indentation for chapter metadata
It should be at a deeper level than the chapter it belongs to.
2021-02-03 10:41:29 +01:00
Anton Khirnov
80aad8886a av_dump_format: add a heading for chapters
Otherwise the chapters look like a part of the metadata section.
2021-02-03 10:41:20 +01:00
Andreas Rheinhardt
bb072a0369 avformat/rtmppkt: Only compile ff_rtmp_packet_dump if defined(DEBUG)
It is only used in this case.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-02 23:53:29 +01:00
Andreas Rheinhardt
7b43646e18 avformat/avio: Remove ffurl_open
It is only used in commented-out (and nonworking) code in async.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-02 23:53:29 +01:00
Andreas Rheinhardt
5cad6c6e85 avformat/rtmpproto: Only include RTMP protocols that are enabled
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-02 23:53:29 +01:00