wtvfile_read_packet did not abide by the requirements of an
AVIOContext's read_packet-function: If it did not read anything,
it returned zero, which currently leads to a warning in read_packet_wrapper
in aviobuf.c. Said warning will be an av_assert2 as soon as
FF_API_OLD_AVIO_EOF_0 is zero (probably the next major version bump).
So instead forward the error code from the underlying protocol.
This error/assert is triggered in the wtv-demux FATE test.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: James Almer <jamrial@gmail.com>
Fixes#8314.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: James Almer <jamrial@gmail.com>
Fixes: left shift of negative value -14614752
Fixes: 15174/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5670543606415360
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>
Fixes out of array read
Fixes: 049fdf78565f1ce5665df236d90f8657/asan_heap-oob_10a5a97_1026_42f9d4855547329560f385768de2f3fb.wtv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Needed for noStreams.wtv unless something else forces continued parsing (like looking for more than 1
frame in attachments)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
The index creation is O(N^2) with number of entries (typically thousands).
On a Pi this can take more than 60 seconds to execute for a recording of a few hours.
By replacing with an O(N) loop, this takes virtually zero time
Liked-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de':
Use gmtime_r instead of gmtime and localtime_r instead of localtime
Conflicts:
libavformat/mov.c
libavformat/mxfenc.c
libavformat/wtvdec.c
libavutil/parseutils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9dcf2397219ca796f0fafce2a703770d6fd09920':
lavf: Check the return value of strftime
Conflicts:
libavformat/wtvdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '851ace79a307bea54b44bd6f7ecd3b7861c28ec6':
wtv: Avoid needlessly calling gmtime twice with the same argument
Conflicts:
libavformat/wtvdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Files produced by windows media center contain meaningless mpeg1 sequence
header. The mpeg2 decoder detects the presence mpeg1 sequence header start
codes and attempts to decode the stream as mpeg1. (This problem introduced
in 73a2d16b.)
Fixes ticket #3601.
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Previously the demuxer was testing against avio_tell, and this would generate
many false warnings.
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '83c285f88016b087c2f0f4b9ef356ad8ef12d947':
wtv: Add more sanity checks for a length read from the file
Conflicts:
libavformat/wtv.c
See: c42efad3c3
Merged-by: Michael Niedermayer <michaelni@gmx.at>