]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/apetag.c
mov: fix assigment check
[ffmpeg] / libavformat / apetag.c
index 22884ef6e09ebfa929e79f24cbfc537756c75a6b..bd8d0ed48554af64ffe899a71b9375f70c07e2f6 100644 (file)
@@ -57,8 +57,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;