[FFmpeg-devel] [PATCH 1/3] avcodec/packet: add a define for the max buffer size a packet can hold

James Almer jamrial at gmail.com
Wed Jun 21 23:46:56 EEST 2023


Signed-off-by: James Almer <jamrial at gmail.com>
---
TODO: Version bump and APIchanges entry.

 libavcodec/packet.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index f28e7e7011..f7dd687c23 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -418,6 +418,11 @@ typedef struct AVPacket {
     AVRational time_base;
 } AVPacket;
 
+/**
+ * Max size for an AVPacket data buffer.
+ */
+#define AV_PKT_MAX_PAYLOAD_SIZE ((size_t)(INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE))
+
 #if FF_API_INIT_PACKET
 attribute_deprecated
 typedef struct AVPacketList {
-- 
2.41.0



More information about the ffmpeg-devel mailing list