summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/asfdec_f.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index 053c815977..ff6ddfb967 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -415,7 +415,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
tag1 = avio_rl32(pb);
avio_skip(pb, 20);
if (sizeX > 40) {
- if (size < sizeX - 40)
+ if (size < sizeX - 40 || sizeX - 40 > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR_INVALIDDATA;
st->codecpar->extradata_size = ffio_limit(pb, sizeX - 40);
st->codecpar->extradata = av_mallocz(st->codecpar->extradata_size +