aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-17 20:38:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-17 20:42:26 +0200
commit8c71de762b84df7520f04818f98d6d70dbb063f2 (patch)
tree744bd3f14c373fb3c7a5a07b612ada52a0309bd9
parent43633c5388d3237a492ba9614fc276c283c4e21a (diff)
parentc5560e72d0bb69f8a1ac9536570398f84388f396 (diff)
downloadffmpeg-8c71de762b84df7520f04818f98d6d70dbb063f2.tar.gz
Merge commit 'c5560e72d0bb69f8a1ac9536570398f84388f396'
* commit 'c5560e72d0bb69f8a1ac9536570398f84388f396': apetag: Fix APE tag size check Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/apetag.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 7d2f0b3222..c8d1bdca5a 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -55,8 +55,10 @@ static int ape_tag_read_field(AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
return -1;
}
- if (size >= UINT_MAX)
- return -1;
+ if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
+ av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
+ return AVERROR_INVALIDDATA;
+ }
if (flags & APE_TAG_FLAG_IS_BINARY) {
uint8_t filename[1024];
enum AVCodecID id;