summaryrefslogtreecommitdiff
path: root/libavformat/wtvdec.c
Commit message (Collapse)AuthorAge
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/wtvdec: Check for EOF before seeking back in parse_media_type()Michael Niedermayer2021-08-06
| | | | | | | | | Fixes: Infinite loop Fixes: 36311/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-4889181296918528 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>
* avformat: move AVStream.{parser,need_parsing} to AVStreamInternalJames Almer2021-05-07
| | | | | | | Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.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/wtvdec: Improve size overflow checks in parse_chunks()Michael Niedermayer2021-04-22
| | | | | | | | | Fixes: signed integer overflow: 32 + 2147483647 cannot be represented in type 'int Fixes: 32967/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5132856218222592 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>
* avformat: Add and use helper function to add attachment streamsAndreas Rheinhardt2021-04-01
| | | | | | | | | All instances of adding attached pictures to a stream or adding a stream and an attached packet to said stream have several things in common like setting the index and flags of the packet, setting the stream disposition etc. This commit therefore factors this out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/wtvdec: Check size in SBE2_STREAM_DESC_EVENT / stream2_guidMichael Niedermayer2021-03-29
| | | | | | | | Fixes: signed integer overflow: 539033600 - -1910497124 cannot be represented in type 'int' Fixes: 30928/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5922630966312960 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wtvdec: Check len in parse_chunks() to avoid overflowMichael Niedermayer2021-02-09
| | | | | | | | | 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>
* avformat/wtvdec: Check for EOF before potentially reseting the eof stateMichael Niedermayer2021-02-09
| | | | | | | | 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>
* avformat/wtvdec: Check dir_lengthMichael Niedermayer2020-10-21
| | | | | | | | | Fixes: Infinite loop Fixes: 26445/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5125558331244544 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>
* avformat/wtvdec: Forward errors when reading packetAndreas Rheinhardt2020-02-19
| | | | | | | | | | | | | | | 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>
* avformat/wtvdec: CosmeticsAndreas Rheinhardt2020-01-07
| | | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/wtvdec: Fix memleak when reading header failsAndreas Rheinhardt2020-01-07
| | | | | | | | 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>
* avformat/wtvdec: Avoid (32bit signed) sectorsMichael Niedermayer2019-06-14
| | | | | | | | | 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>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* libavformat/wtvdec: return AVERROR_EOF on EOFDaniel Kucera2017-10-13
| | | | | Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com> Signed-off-by: wm4 <nfxjfg@googlemail.com>
* Use the new AVIOContext destructor.Anton Khirnov2017-09-01
| | | | | (cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19) Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/wtvdec: Check pointer before useMichael Niedermayer2016-08-21
| | | | | | | | 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>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
| | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
| | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/wtvdec: Set AVFMTCTX_NOHEADERMichael Niedermayer2016-03-19
| | | | | | | 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>
* Merge commit '29c2d06d67724e994980045afa055c6c34611b30'Derek Buitenhuis2016-02-24
| | | | | | | * commit '29c2d06d67724e994980045afa055c6c34611b30': cosmetics: Drop empty comment lines Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* wtvdec: Removed unused variableTimothy Gu2016-01-31
|
* wtv: Speed up wtv index creationpopcornmix2016-02-01
| | | | | | | | | | | 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>
* Merge commit 'd80811c94e068085aab797f9ba35790529126f85'Michael Niedermayer2015-07-12
| | | | | | | | | | | | | | | | | | | * commit 'd80811c94e068085aab797f9ba35790529126f85': riff: Use the correct logging context Conflicts: libavformat/asfdec_o.c libavformat/avidec.c libavformat/dxa.c libavformat/matroskadec.c libavformat/mov.c libavformat/riff.h libavformat/riffdec.c libavformat/wavdec.c libavformat/wtvdec.c libavformat/xwma.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wtvdec: Use 64bit for ret to avoid overflowMichael Niedermayer2015-02-20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wtvdec: fix integer overflow resulting in errors with large filesRodger Combs2015-02-20
| | | | | | This fixes a regression in 9fbc613f0df1628e7e78bca791fa8833846f8210 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
| | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/wtvdec: Use av_freep() avoid leaving stale pointers in memoryMichael Niedermayer2014-12-25
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wavdec: RIFX file format supportThomas Volkert2014-12-18
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de'Michael Niedermayer2014-10-26
| | | | | | | | | | | | | * 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>
* Merge commit '9dcf2397219ca796f0fafce2a703770d6fd09920'Michael Niedermayer2014-10-26
| | | | | | | | | | * commit '9dcf2397219ca796f0fafce2a703770d6fd09920': lavf: Check the return value of strftime Conflicts: libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '851ace79a307bea54b44bd6f7ecd3b7861c28ec6'Michael Niedermayer2014-10-26
| | | | | | | | | | * commit '851ace79a307bea54b44bd6f7ecd3b7861c28ec6': wtv: Avoid needlessly calling gmtime twice with the same argument Conflicts: libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '9fbc613f0df1628e7e78bca791fa8833846f8210'Michael Niedermayer2014-10-20
| | | | | | | * commit '9fbc613f0df1628e7e78bca791fa8833846f8210': wtv: check seek_by_sector return value Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Stop demuxing wtv on eof.Carl Eugen Hoyos2014-10-02
| | | | | | | | | Fixes ticket #3991. Fixes ticket #3995. Fixes ticket #3997. Reviewed-by: Peter Ross Reviewed-by: Paul B Mahol
* avformat/wtvdec: seek over broken chunksPeter Ross2014-08-29
| | | | | | | Fixes ticket #3898 Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/wtvdec: ignore mpeg2 extradataPeter Ross2014-05-01
| | | | | | | | | | | | 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>
* avformat/wtvdec: populate codec_tag from BITMAPINFOHEADERPeter Ross2014-04-04
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/wtvdec: ignore MPEG2VIDEO extradata when count is invalidPeter Ross2014-04-04
| | | | | | | Fixes ticket #3522. Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/wtvdec: demux mpeg2 extradataPeter Ross2014-03-30
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'Michael Niedermayer2014-03-11
| | | | | | | | | | | | | | | | | | | | | * commit 'd92024f18fa3d69937cb2575f3a8bf973df02430': lavf: more correct printf format specifiers Conflicts: libavformat/asfdec.c libavformat/cafdec.c libavformat/dxa.c libavformat/framecrcenc.c libavformat/hnm.c libavformat/iff.c libavformat/mov.c libavformat/mxfdec.c libavformat/rmdec.c libavformat/rpl.c libavformat/smacker.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* wtv: make ff_format_videoinfo2 visible to wtv encoderPeter Ross2013-12-23
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wtvenc: test avio_size() validityPeter Ross2013-12-23
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* wtvdec: when testing for truncated files, actually check the .wtv file sizePeter Ross2013-12-21
| | | | | | | | 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>
* Merge commit 'c0bba95c2363641d3297b3852b2ece1474cda295'Michael Niedermayer2013-11-03
| | | | | | | * commit 'c0bba95c2363641d3297b3852b2ece1474cda295': wtv: fix variable sign in format Merged-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/wtvdec: drop SHIFT_SECTOR_BITS() macroMichael Niedermayer2013-10-19
| | | | | | it just wraps around a bitwise shift, and makes the code harder to read Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-19
| | | | | | | | | | | * qatar/master: wtv: Seek by sector properly Conflicts: libavformat/wtvdec.c See: a0d13d84a928110b0e99ea16d17fd758fcbde35f Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Add some necessary casts in the wtv demuxer.Carl Eugen Hoyos2013-10-17
| | | | This reverts e8023dba, fixes ticket #3049.
* Merge commit '83c285f88016b087c2f0f4b9ef356ad8ef12d947'Michael Niedermayer2013-09-20
| | | | | | | | | | | * commit '83c285f88016b087c2f0f4b9ef356ad8ef12d947': wtv: Add more sanity checks for a length read from the file Conflicts: libavformat/wtv.c See: c42efad3c34cace09555e05fd0cb81cb59cc726f Merged-by: Michael Niedermayer <michaelni@gmx.at>