aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/utils: set AVFrame format unconditionalMichael Niedermayer2014-02-231-2/+1
| | | | | | | | | | | | Fixes inconsistency and out of array accesses Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit e5c7229999182ad1cef13b9eca050dba7a5a08da) Conflicts: libavcodec/utils.c
* lavc/utils: check av_frame_alloc() failure.Nicolas George2014-01-071-0/+4
| | | | | | (cherry picked from commit 38004051b53ddecb518053e6dadafa9adc4fc1b2) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/utils: drop 2 dependancies on sizeof(AVFrame)Michael Niedermayer2014-01-071-10/+16
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit c90f31146e8b1407a4a5808d0d904d85baeed5d4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/utils: implement avcodec_alloc_frame() through av_alloc_frame()Michael Niedermayer2014-01-071-9/+1
| | | | | | | | | | This ensures that theres just one AVFrame allocation function and libs dont produce multiple AVFrame variants after a minor lib update Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 5abdda214df53f009434f19b9eb8e1375f2924d9) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* do O(1) instead of O(n) atomic operations in register functionsMichael Niedermayer2014-01-071-2/+3
| | | | | | | | | about 1ms faster startup time Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 133fbfc7811ffae7b97dd129fcd0b5e646742362) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec: move end zeroing code from av_packet_split_side_data() to ↵Michael Niedermayer2014-01-071-0/+10
| | | | | | | | | | | | | | | avcodec_decode_subtitle2() This code changes the input packet, which is read only and can in rare circumstances lead to decoder errors. (i run into one of these in the audio decoder, which corrupted the packet during av_find_stream_info() so that actual decoding that single packet failed later) Until a better fix is implemented, this commit limits the problem. A better fix might be to make the subtitle decoders not depend on data[size] = 0 or to copy their input when this is not the case. (cherry picked from commit 01923bab98506b1e98b4cbf08419364ce6ffea6d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavc: add support for CODEC_CAP_DELAY in subtitlesMarton Balint2013-10-271-2/+2
| | | | | | | | | | | This patch adds CODEC_CAP_DELAY support to avcodec_decode_subtitle2. For DVB teletext decoding, a single teletext packet can contain multiple teletext pages. In order to support that, the teletext decoder may buffer some pages. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/utils: use a default lock manager that uses a pthread mutexMichael Niedermayer2013-10-231-1/+56
| | | | | | | | That makes avformat & avcodec thread safe without the need to explicitly register a lock manager. Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/pthread: add wpp apiMickaël Raulet2013-10-221-0/+17
| | | | | | | | | | | cherry picked from commit c7765f3295fe7dc0653161c6a3d3e1778b76ee67 cherry picked from commit 0008c4979fc1d1bc24d4d2c791715f6dd017563c Conflicts: libavcodec/utils.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavc: make avcodec_decode_subtitle2 more robustMarton Balint2013-10-201-0/+6
| | | | | Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/utils: add some saftey checks to add_metadata_from_side_data()Michael Niedermayer2013-10-191-1/+8
| | | | | | | This fixes potential overreads with crafted files. Found-by: wm4 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavc: Adding seek_preroll to AVCodecContextVignesh Venkatasubramanian2013-10-141-0/+1
| | | | | | | | | seek_preroll field is added to the AVCodecContext struct. It indicates the number of samples to be discarded whenever there is a discontinuity. The minor version is bumped accordingly. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec: add av_codec_get_max_lowres()Michael Niedermayer2013-10-031-0/+5
| | | | | Reviewed-by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '7e52080cb18332cb1da9fe133498750b6b4b0fb3'Michael Niedermayer2013-09-271-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7e52080cb18332cb1da9fe133498750b6b4b0fb3': pcm: support 24-bit/32-bit little-endian planar Conflicts: doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/pcm.c libavcodec/version.h libavformat/nut.c See: 467dfd5dfae7cc435a2b2e7cf012a0de2fea5848 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * pcm: support 24-bit/32-bit little-endian planarPaul B Mahol2013-09-271-0/+2
| | | | | | | | | | | | Used by LXF. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec: fix duplicate includesMichael Niedermayer2013-09-211-1/+0
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil: add av_get_colorspace_name()Michael Niedermayer2013-09-191-15/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff'Michael Niedermayer2013-09-191-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c4bfa098072ba338d83555d6e2199f7e1e64ffff': Add a WebP decoder Conflicts: Changelog doc/general.texi libavcodec/Makefile libavcodec/avcodec.h libavcodec/version.h libavformat/img2.c The previously existing webp decoder is disabled as the new one supports lossless mode and alpha while the previous does not. Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: add 16bit planar YUV formats to avcodec_align_dimensions2()Michael Niedermayer2013-09-111-0/+12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/utils: Add support for discarding samples from the endVignesh Venkatasubramanian2013-09-101-0/+21
| | | | | | | | | | | | | | | | | | Adding support for discarding samples from the end based on the value in AV_PKT_DATA_SKIP_SAMPLES side data's bytes 5-8. Signed-off By: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/util: Make size argument of ff_alloc_packet2() int64_tMichael Niedermayer2013-09-091-4/+4
| | | | | | | | | | | | This ensures that huge sizes dont get truncated before the check in ff_alloc_packet2() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: make avcodec_close() more tolerant.Clément Bœsch2013-09-041-1/+6
| | | | | | | | See previous commit.
* | Show subtitle resolution in avcodec_string().Carl Eugen Hoyos2013-09-041-0/+5
| |
* | avcodec/utils: avcodec_string: print colorspace typeMichael Niedermayer2013-08-311-0/+15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: avcodec_string: Print color_rangeMichael Niedermayer2013-08-311-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: avcodec_string: make the colorspace printing code more ↵Michael Niedermayer2013-08-311-2/+6
| | | | | | | | | | | | extendible. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: support non edge emu for grayscaleMichael Niedermayer2013-08-291-1/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-08-211-1/+1
|\| | | | | | | | | | | | | * qatar/master: avcodec/utils: Simplify a condition that combines HAVE_NEON and ARCH_ARM Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec/utils: Simplify a condition that combines HAVE_NEON and ARCH_ARMDiego Biurrun2013-08-211-1/+1
| |
* | Fix wrong use of "an" in some comments.Thilo Borgmann2013-08-121-1/+1
| |
* | avcodec: Remove ff_packet_free_side_data, use av_packet_free_side_dataMichael Niedermayer2013-08-121-4/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Integrate accessors.h header into internal.hReimar Döffinger2013-08-101-1/+0
| | | | | | | | | | | | | | I have no idea why I added a separate header, I think there is no good reason for it. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Reduce MAKE_ACCESSORS code duplication via a new header.Reimar Döffinger2013-08-081-4/+1
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '7950e519bb094897f957b9a9531cc60ba46cbc91'Michael Niedermayer2013-08-031-0/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7950e519bb094897f957b9a9531cc60ba46cbc91': Disable deprecation warnings for cases where a replacement is available Conflicts: libavcodec/avpacket.c libavcodec/pthread.c libavcodec/utils.c libavdevice/v4l2.c libavfilter/avfiltergraph.c libavfilter/buffersrc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Disable deprecation warnings for cases where a replacement is availableDiego Biurrun2013-08-021-0/+13
| |
| * lavc: free the padded last frame during audio encoding properlyAnton Khirnov2013-06-201-6/+1
| |
* | lavc: do not override format if neither text nor bitmap codec prop is setMarton Balint2013-07-271-1/+4
| | | | | | | | | | | | | | Some decoders may output both, this way the decoder can set it. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Show max bitrate for mpeg2 video streams in avcodec_string().Carl Eugen Hoyos2013-07-251-0/+3
| | | | | | | | See also 25b7aa9
* | avcodec/utils: Warn the user about the lack of a lock manager if ↵Michael Niedermayer2013-07-241-0/+2
| | | | | | | | | | | | | | | | | | | | insufficient locks are detected A lock manager is not the only possibility to avoid open/close locking issues but its easier and more robust than maintaining a lot of lock/unlock calls. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: use av_assert0() to check validity of input pointers for ↵Michael Niedermayer2013-07-231-1/+1
| | | | | | | | | | | | start code search Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: add avcodec_chroma_pos_to_enum()Michael Niedermayer2013-07-231-0/+11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: add avcodec_enum_to_chroma_pos()Michael Niedermayer2013-07-231-0/+12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/avutil: Add AVColorSpace and AVColorRange to AVFramesMichael Niedermayer2013-07-171-0/+5
| | | | | | | | | | | | This also moves AVColorSpace and AVColorRange from avcodec to avutil Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ADPCM IMA WAV 2, 3 and 5 bits decoderPaul B Mahol2013-07-051-1/+3
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Avoid a null pointer dereference in avcodec_decode_audio4().Carl Eugen Hoyos2013-07-011-0/+2
| | | | | | | | | | This could happen if oom occured while probing a file. Fixes ticket #2722.
* | avcodec: Make av_register_hwaccel() and avcodec_register() thread safeMichael Niedermayer2013-06-291-6/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Avoid a null pointer dereference in avcodec_decode_video2().Carl Eugen Hoyos2013-06-281-0/+2
| | | | | | | | | | This could happen if oom occured while probing a file. Reported in ticket #1900.
* | lavc/utils: improve feedback in case of invalid packet sizeStefano Sabatini2013-06-261-2/+7
| |
* | Merge commit '985f34b75653d02eda8eb8def3412f8577f19b01'Michael Niedermayer2013-06-171-0/+3
|\| | | | | | | | | | | | | | | | | | | * commit '985f34b75653d02eda8eb8def3412f8577f19b01': utils: fix avcodec_flush_buffers pre-reference counting compatibility Conflicts: libavcodec/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * utils: fix avcodec_flush_buffers pre-reference counting compatibilityJanne Grunau2013-06-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The to_free AVframe must be freed just like the other ones. Indeed, the calling application may expect all frames to be released. (This regression caused use-after-free in VLC with hwaccel.) Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>