summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* avformat/mov: Extend data_size check in mov_read_udta_string()Michael Niedermayer2021-03-01
| | | | | | | | Fixes: signed integer overflow: -2147483634 - 16 cannot be represented in type 'int' Fixes: 28322/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5711888402612224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aadec: Check for EOF while reading chaptersMichael Niedermayer2021-03-01
| | | | | | | | Fixes: timeout Fixes: 28199/clusterfuzz-testcase-minimized-ffmpeg_dem_AA_fuzzer-4896162657861632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/voc_packet: Add a basic check on max_sizeMichael Niedermayer2021-03-01
| | | | | | | | Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 'int' Fixes: 28127/clusterfuzz-testcase-minimized-ffmpeg_dem_VOC_fuzzer-4880586455646208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/sga: improve probing for valid filesPaul B Mahol2021-03-01
| | | | Update variables depending on high four bits of first two bytes.
* avformat: add Digital Pictures SGA game demuxerPaul B Mahol2021-03-01
|
* Remove double ';'Andreas Rheinhardt2021-03-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webmdashenc: Use av_strstart instead of strncmpAndreas Rheinhardt2021-02-28
| | | | | | | It makes the intent clearer and avoids calculating the length separately. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Use av_strstart instead of strncmpAndreas Rheinhardt2021-02-28
| | | | | | | It makes the intent clearer and avoids calculating the length separately. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/avio: Use av_strstart instead of strncmpAndreas Rheinhardt2021-02-28
| | | | | | | It makes the intent clearer and avoids calculating the length in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/pcmdec: Beautify pcm_read_headerAndreas Rheinhardt2021-02-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/pcmdec: Simplify parsing MIME typeAndreas Rheinhardt2021-02-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/pcmdec: Fix NULL + 1Andreas Rheinhardt2021-02-28
| | | | | | It is undefined behaviour. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/pcm(dec|enc): Don't include disabled (de)muxersAndreas Rheinhardt2021-02-28
| | | | | | | | Also make the macro used for the demuxers spec-compliant. The earlier macro was not, because the ... argument of a variadic macro must not be left out. GCC and Clang warn about this when using -pedantic. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Only check for timecodes if they are usedAndreas Rheinhardt2021-02-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Don't check for disabled muxersAndreas Rheinhardt2021-02-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Remove always true checkAndreas Rheinhardt2021-02-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenccenc: Fix memory leak for muxing CENC-encrypted filesVadym Bezdushnyi2021-02-27
| | | | | | | | | | | | | | | | | | | | | | | | Memory for auxillary_info was not freed after usage. Leak can be reproduced with following commands: Optionally, generate input video: ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 input.mp4 Run ffmpeg with valgrind: valgrind --leak-check=full --show-leak-kinds=all \ ffmpeg -y -i input.mp4 -vcodec copy -acodec copy \ -encryption_scheme cenc-aes-ctr \ -encryption_key 00000000000000000000000000000000 \ -encryption_kid 00000000000000000000000000000000 \ ffmpeg_encrypted.mp4 For test video which has duration of 10 sec, leak is 4 Kb. For 100 sec video, leak will be 33 Kb. Most likely, leaked memory will grow linearly to the number of input frames. Signed-off-by: Vadym Bezdushnyi <vadim.bezdush@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/matroskadec: Add webm file extensionAndreas Rheinhardt2021-02-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/concat: Remove unnecessary checkAndreas Rheinhardt2021-02-27
| | | | | | | | | This code was written when the allocation functions used parameters of type unsigned. This is no longer true today and therefore we only need to check whether the multiplication of the array's size stays within a size_t -- and this can be offloaded to av_realloc_array. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/spdifenc: Fix leak upon errorAndreas Rheinhardt2021-02-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/wavenc: Fix leak and segfault on reallocation errorAndreas Rheinhardt2021-02-27
| | | | | | | | | | | | | | | | | | | | | Up until now, the wav muxer used a reallocation of the form ptr = av_realloc(ptr, size); that leaks upon error. Furthermore, if a failed reallocation happened when writing the trailer, a segfault would occur due to avio_write(NULL, size) because the muxer only prints an error message upon allocation error, but does not return the error. Moreover setting the pointer to the buffer to NULL on error seems to be done on purpose in order to record that an error has occured so that outputting the peak values is no longer attempted. This behaviour has been retained by simply disabling whether peak data should be written if an error occurs. Finally, the reallocation is now done once per peak block and not once per peak block per channel; it is also done with av_fast_realloc and not with a linear size increase. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/imx: set video stream durationPaul B Mahol2021-02-25
|
* avcodec/imx: use ff_reget_buffer()Paul B Mahol2021-02-25
| | | | | Also flush internal stuff upon seeking. This codec is not intra only.
* avformat/avlanguage: Remove long disabled av_convert_lang_toAndreas Rheinhardt2021-02-25
| | | | | | | | 1582e306a47977b09fddb029b999f99eb03cd485 scheduled it for removal with libavformat major version 58, but it was never removed. Reviewed-by: Paul B Mahol <onemda@gmail.com Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/wavenc: Improve unsupported codec error messagesAndreas Rheinhardt2021-02-25
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Handle AVID MJPEG streams directly in the MJPEG decoder.Anton Khirnov2021-02-25
| | | | | | | | | | | | | | | | | | | | AVID streams - currently handled by the AVRN decoder - can be (depending on extradata contents) either MJPEG or raw video. To decode the MJPEG variant, the AVRN decoder currently instantiates a MJPEG decoder internally and forwards decoded frames to the caller (possibly after cropping them). This is suboptimal, because the AVRN decoder does not forward all the features of the internal MJPEG decoder, such as direct rendering. Handling such forwarding in a full and generic manner would be quite hard, so it is simpler to just handle those streams in the MJPEG decoder directly. The AVRN decoder, which now handles only the raw streams, can now be marked as supporting direct rendering. This also removes the last remaining internal use of the obsolete decoding API.
* avformat/vpk: check that samples_per_block is > 0Paul B Mahol2021-02-24
| | | | Fixes floating point exception.
* avformat/asf: Move ff_asf_audio_conceal_none to its only userAndreas Rheinhardt2021-02-24
| | | | | | | It is only used inside code guarded by #ifdef DEBUG, i.e. it is normally unused. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/Makefile: Remove unnecessary dependencies on vocdecAndreas Rheinhardt2021-02-23
| | | | | | | | | | | | | | Commit 0d1229f1d2b8f26dd50c6be7917bb8ed8cb95364 factored the main part of the voc demuxer's read_packet function out; yet when this Libav commit was merged in f99195d56f4aab266926724ca1cfae822df4df16, the dependency of the other users of this function on vocdec.o was unnecessarily kept. This commit fixes this. While just at it, also disable the data only used by the voc demuxer and muxer in voc.c if both of them are disabled. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/imx: remove unused headerPaul B Mahol2021-02-23
|
* avformat/wavdec: Share wav and w64 optionsAndreas Rheinhardt2021-02-23
| | | | | | | | The options of the w64 demuxer are a proper subset of the options for the wav demuxer, making it possible to reuse a part of the options for the wav demuxer for the w64 demuxer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/wav: Deduplicate codec tags listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/avienc, wtvenc: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/aiff: Deduplicate codec tags and codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ast: Deduplicate codec tags listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Deduplicate codec tags listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/oma: Move stuff only used by demuxer to demuxerAndreas Rheinhardt2021-02-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/oma: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/rso: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/voc: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/caf: Deduplicate codec tags listAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/asfenc: Deduplicate codec tags listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves relocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/au: Deduplicate codec_tag listsAndreas Rheinhardt2021-02-23
| | | | | | Also saves a relocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/isom: Remove outcommented functionAndreas Rheinhardt2021-02-23
| | | | | | There is another ff_mov_read_chan in mov_chan.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/isom: Split movaudio/movvideo tags off into a separate fileAndreas Rheinhardt2021-02-23
| | | | | | | | | The NUT and avi demuxers only need ff_codec_movvideo_tags and so this removes a dependency on the rest of isom.c as well as on mpeg4audio.c (which isom depends on); it is similar for the Matroska demuxer and muxers, except that the mpeg4audio.c dependency can't be avoided. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/Makefile: Remove outdated AIFF demuxer dependency on iso_mediaAndreas Rheinhardt2021-02-23
| | | | | | | | | | | | | | | | This is a result of the mov channel parsing stuff being factored out of mov.c twice: Once in 91b782720fd0df5571775b6591bc41797d6ecf78 to isom.c and later in 3bab7cd12802dc5abf2c5cc6dec49e9e249ce204. Also remove the isom.h header; and while just at it, remove an unused mathematics.h inclusion. (isom.c actually depends upon mpeg4audio from libavcodec for avpriv_mpeg4audio_get_config2 and avpriv_mpa_freq_tab; yet there is no configure dependency for iso_media which leads to failure of shared builds.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: remove pointless lowres deprecation wrappersJames Almer2021-02-22
| | | | | | | | Neither the feature, public fields, or AVOptions were ever truly deprecated, nor will have been removed if this FF_API_ define was left in place, so get rid of it as it's misleading. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: fix timecode with counter mode flag setMark Reid2021-02-22
| | | | | | | | | | | | | | | | | | | | | The current behaviour ends up squaring the avg_frame_rate if the conter mode flag is set. This messes up the timecode calculation, and looks to me as a regression that seems to have been introduced 428b4aac. Upon further testing is seems that no special case is need for having the counter flag set. av_timecode_init appears to handles the timecode correctly, at least in the sample files I have. Here is a sample mov file with the counter flag set https://www.dropbox.com/s/5l4fucb9lhq523s/timecode_counter_mode.mov before the patch ffmpeg will report the timecode as: 00:37:11:97 and warns that the timecode framerate is 576000000/1002001 after patch: 14:50:55:02 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat/matroskaenc: Add support for FlagTextDescriptionsAndreas Rheinhardt2021-02-22
| | | | | | | | This is the Matroska equivalent of D_WEBVTT_DESCRIPTIONS and is therefore only enabled for subtitles. Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Add support for FlagTextDescriptionsAndreas Rheinhardt2021-02-22
| | | | | | | | This is the equivalent of the WebM "D_WEBVTT/DESCRIPTIONS" and is therefore only exported for subtitles. Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>