[FFmpeg-devel] [PATCH 3/3] avformat: use AV_PKT_MAX_PAYLOAD_SIZE
James Almer
jamrial at gmail.com
Wed Jun 21 23:46:58 EEST 2023
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavformat/4xm.c | 2 +-
libavformat/flac_picture.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index fdf6e4b84b..1a35299254 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -328,7 +328,7 @@ static int fourxm_read_packet(AVFormatContext *s,
case cfr2_TAG:
/* allocate 8 more bytes than 'size' to account for fourcc
* and size */
- if (size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 8)
+ if (size > AV_PKT_MAX_PAYLOAD_SIZE - 8)
return AVERROR_INVALIDDATA;
if (fourxm->video_stream_index < 0)
return AVERROR_INVALIDDATA;
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index b33fee75b4..16a053c6ea 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -120,7 +120,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t **bufp, int buf_size,
left = bytestream2_get_bytes_left(&g);
if (len <= 0 || len > left) {
- if (len > MAX_TRUNC_PICTURE_SIZE || len >= INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) {
+ if (len > MAX_TRUNC_PICTURE_SIZE || len >= AV_PKT_MAX_PAYLOAD_SIZE) {
av_log(s, AV_LOG_ERROR, "Attached picture metadata block too big %u\n", len);
if (s->error_recognition & AV_EF_EXPLODE)
return AVERROR_INVALIDDATA;
--
2.41.0
More information about the ffmpeg-devel
mailing list