summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
Commit message (Collapse)AuthorAge
* avdevice/decklink_dec: Added Closed caption decode from VANCKarthick J2017-09-28
| | | | | Signed-off-by: Karthick J <kjeyapal@akamai.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/avpacket: deprecate av_copy_packet()James Almer2017-09-25
| | | | | | It does the same thing as av_packet_ref(). Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/avpacket: Limit iterations in ff_packet_split_and_drop_side_data()Michael Niedermayer2017-06-11
| | | | | | | | | This avoids scaning beyond what a valid packet can contain Fixes: Timeout Fixes: 541/clusterfuzz-testcase-610189291657625 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/avpacket: allow only one element per type in packet side dataJames Almer2017-05-12
| | | | | | | | | | It was never meant to do otherwise, as av_packet_get_side_data() returns the first entry it finds of a given type. Based on code from libavformat's av_stream_add_side_data(). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/avcodec: Limit the number of side data elements per packetMichael Niedermayer2017-05-12
| | | | | | | | | Fixes: 1293/clusterfuzz-testcase-minimized-6054752074858496 See: [FFmpeg-devel] [PATCH] avcodec/avcodec: Limit the number of side data elements per packet Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: Avoid splitting side data repeatedlyMichael Niedermayer2017-05-06
| | | | | | | | Fixes Timeout Fixes: 508/clusterfuzz-testcase-6245747678773248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc: Add Content Light Level side metadata found in HEVCSteve Lhomme2017-04-06
| | | | | | These data are necessary when transmitting HDR over HDMI. Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit 'adb0e941c329a4778ade6dd0a326274472992f54'Clément Bœsch2017-04-01
|\ | | | | | | | | | | | | | | | | * commit 'adb0e941c329a4778ade6dd0a326274472992f54': avpacket: Mark src pointer as constant See 5bb3f8825584a319b25b430e4ece2fa5b2b47ff9 Merged-by: Clément Bœsch <u@pkh.me>
| * avpacket: Mark src pointer as constantLuca Barbato2016-11-17
| |
| * avpacket: Error out when creating 0-sized side dataVittorio Giovara2016-06-13
| | | | | | | | | | | | | | | | This mimics the behaviour of other av_*_new_side_data(). This is not caught by the malloc check, since padding is always added to the allocated size. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec, avformat: deprecate anything related to side data mergingwm42017-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch deprecates anything that has to do with merging/splitting side data. Automatic side data merging (and splitting), as well as all API symbols involved in it, are removed completely. Two FF_API_ defines are dedicated to deprecating API symbols related to this: FF_API_MERGE_SD_API removes av_packet_split/merge_side_data in libavcodec, and FF_API_LAVF_KEEPSIDE_FLAG deprecates AVFMT_FLAG_KEEP_SIDE_DATA in libavformat. Since it was claimed that changing the default from merging side data to not doing it is an ABI change, there are two additional FF_API_ defines, which stop using the side data merging/splitting by default (and remove any code in avformat/avcodec doing this): FF_API_MERGE_SD in libavcodec, and FF_API_LAVF_MERGE_SD in libavformat. It is very much intended that FF_API_MERGE_SD and FF_API_LAVF_MERGE_SD are quickly defined to 0 in the next ABI bump, while the API symbols are retained for a longer time for the sake of compatibility. AVFMT_FLAG_KEEP_SIDE_DATA will (very much intentionally) do nothing for most of the time it will still be defined. Keep in mind that no code exists that actually tries to unset this flag for any reason, nor does such code need to exist. Code setting this flag explicitly will work as before. Thus it's ok for AVFMT_FLAG_KEEP_SIDE_DATA to do nothing once side data merging has been removed from libavformat. In order to avoid that anyone in the future does this incorrectly, here is a small guide how to update the internal code on bumps: - next ABI bump (probably soon): - define FF_API_LAVF_MERGE_SD to 0, and remove all code covered by it - define FF_API_MERGE_SD to 0, and remove all code covered by it - next API bump (typically two years in the future or so): - define FF_API_LAVF_KEEPSIDE_FLAG to 0, and remove all code covered by it - define FF_API_MERGE_SD_API to 0, and remove all code covered by it This forces anyone who actually wants packet side data to temporarily use deprecated API to get it all. If you ask me, this is batshit fucked up crazy, but it's how we roll. Making AVFMT_FLAG_KEEP_SIDE_DATA to be set by default was rejected as an ABI change, so I'm going all the way to get rid of this once and for all. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/avpacket: Make pkt parameter of av_packet_get_side_data() const.Carl Eugen Hoyos2017-03-16
| | | | | | | | | | Reflects the actual code and silences a gcc warning: libavcodec/utils.c:2102:36: warning: passing argument 1 of 'av_packet_get_side_data' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
* | avcodec/avpacket: Check metadata key in av_packet_unpack_dictionary()Michael Niedermayer2017-03-01
| | | | | | | | | | | | | | | | Fixes timeout Fixes: 501/clusterfuzz-testcase-5672752870588416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/avpacket: Initialize a variable in error path.Carl Eugen Hoyos2017-02-17
| | | | | | | | | | | | Fixes ticket #6153. Tested-by: Tyson Smith
* | lavc: Add spherical packet side data APIVittorio Giovara2016-12-07
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/avpacket: fix leak on realloc in av_packet_add_side_data()James Almer2016-11-19
| | | | | | | | | | | | | | | | | | If realloc fails, the pointer is overwritten and the previously allocated buffer is leaked, which goes against the expected behavior of keeping the packet unchanged in case of error. Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to memcpy().Carl Eugen Hoyos2016-09-22
| | | | | | | | Fixes ticket #5857.
* | avcodec/avpacket: clear side_data_elemsMichael Niedermayer2016-09-12
| | | | | | | | | | | | | | Fixes null pointer dereference Found-by: 连一汉 <lianyihan@360.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to memcpy().Carl Eugen Hoyos2016-09-05
| | | | | | | | Fixes ticket #5128.
* | Merge commit '8996515b137f962e3a8691241c285c96437b6c53'Clément Bœsch2016-06-22
|\| | | | | | | | | | | | | | | | | * commit '8996515b137f962e3a8691241c285c96437b6c53': avpacket: fix setting AVPacket.data in av_packet_ref() This commit is a noop, see ed3a02547c71ac06fa27f17ad53116a74f78d927 Merged-by: Clément Bœsch <u@pkh.me>
| * avpacket: fix setting AVPacket.data in av_packet_ref()Anton Khirnov2016-05-16
| | | | | | | | | | | | | | The data field does not necessarily point to the beginning of the underlying AVBuffer. CC: libav-stable@libav.org
* | avcodec/avpacket: Respect payload offset in av_grow_packetAndriy Lysnevych2016-06-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/avpacket: Respect payload offset in av_packet_refAndriy Lysnevych2016-05-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/avpacket: Fix off by 5 errorMichael Niedermayer2016-04-21
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: mozilla bug 1266129 Found-by: Tyson Smith Tested-by: Tyson Smith Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'dbb43b8b83b097585ec255ec638b61e359ebea77'Derek Buitenhuis2016-04-12
|\| | | | | | | | | | | | | * commit 'dbb43b8b83b097585ec255ec638b61e359ebea77': avpacket: properly reset data/size in av_packet_move_ref() Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avpacket: properly reset data/size in av_packet_move_ref()Anton Khirnov2016-02-26
| | | | | | | | | | It currently just calls av_init_packet(), which does not touch those fields.
| * avpacket: fix size check in packet_allocAndreas Cadhalpun2016-01-07
| | | | | | | | | | | | | | | | | | | | | | The previous check only caught sizes from -AV_INPUT_BUFFER_PADDING_SIZE to -1. This fixes ubsan runtime error: signed integer overflow: 2147483647 + 32 cannot be represented in type 'int' Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | libavcodec:add packet level support for mastering metadataNeil Birkbeck2016-02-25
| | | | | | | | | | | | | | | | | | Some containers, like webm/mkv, will contain this mastering metadata. This is analogous to the way 3D fpa data is handled (in frame and packet side data). Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/lavf: transmit stream_id information for mpegts KLV data packetsStefano Sabatini2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | This allows to copy information related to the stream ID from the demuxer to the muxer, thus allowing for example to retain information related to synchronous and asynchronous KLV data packets. This information is used in the muxer when remuxing to distinguish the two kind of packets (if the information is lacking, data packets are considered synchronous). The fate reference changes are due to the use of av_packet_merge_side_data(), which increases the size of the output packet size, since side data is merged into the packet data.
* | avpacket: fix size check in packet_allocAndreas Cadhalpun2016-01-05
| | | | | | | | | | | | | | | | | | | | | | The previous check only caught sizes from -AV_INPUT_BUFFER_PADDING_SIZE to -1. This fixes ubsan runtime error: signed integer overflow: 2147483647 + 32 cannot be represented in type 'int' Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '68e547ae8b455e5e2b60839f35c359d77a6d94bc'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit '68e547ae8b455e5e2b60839f35c359d77a6d94bc': avpacket: use ERANGE instead of EOVERFLOW Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: use ERANGE instead of EOVERFLOWAnton Khirnov2015-12-07
| | | | | | | | EOVERFLOW seems to be unavailable on certain platforms.
* | Merge commit '31c51f7441de07b88cfea2550245bf1f5140cb8f'Hendrik Leppkes2015-12-17
|\| | | | | | | | | | | | | * commit '31c51f7441de07b88cfea2550245bf1f5140cb8f': avpacket: add a function for wrapping existing data as side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: add a function for wrapping existing data as side dataAnton Khirnov2015-12-06
| |
* | Merge commit 'a9a60106370f862e191dea58e748626da6a8fe97'Hendrik Leppkes2015-10-29
|\| | | | | | | | | | | | | * commit 'a9a60106370f862e191dea58e748626da6a8fe97': avpacket: Provide an alloc and a free function for the struct Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Provide an alloc and a free function for the structLuca Barbato2015-10-26
| | | | | | | | | | Pave the way for having the size of the AVPacket struct not part of the ABI.
* | Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'Hendrik Leppkes2015-10-29
|\| | | | | | | | | | | | | * commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6': avpacket: Deprecate av_dup_packet Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Deprecate av_dup_packetLuca Barbato2015-10-26
| | | | | | | | | | As documented, `av_dup_packet` is broken by design, `av_packet_ref` matches the AVFrame ref-counted API and can be safely used instead.
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | | | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-29
|\| | | | | | | | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Make AVPacket.duration int64, and deprecate convergence_durationwm42015-09-29
| | | | | | | | | | | | | | | | | | Note that convergence_duration had another meaning, one which was in practice never used. The only real use for it was a 64 bit replacement for the duration field. It's better just to make duration 64 bits, and to get rid of it. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Remove left-over FF_API_DESTRUCT_PACKET cruftHendrik Leppkes2015-09-05
| |
* | Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8': lavc: Drop deprecated destruct_packet related functions Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Drop deprecated destruct_packet related functionsVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 10/2012.
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Replace AV_PKT_DATA_QUALITY_FACTOR by AV_PKT_DATA_QUALITY_STATSMichael Niedermayer2015-07-22
| | | | | | | | | | | | | | | | | | The stats are a superset of the quality factor, also allowing the picture type and encoder "PSNR" stats to be exported This also replaces the native by fixed little endian order for the affected side data AV_PKT_DATA_QUALITY_FACTOR is left as a synonym of AV_PKT_DATA_QUALITY_STATS Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: Add av_packet_side_data_name()Michael Niedermayer2015-05-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>