summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/mpc8.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index c3c70e051e..29001b19f6 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -145,6 +145,10 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
av_log(s, AV_LOG_ERROR, "No seek table at given position\n");
return;
}
+ if (size < 0 || size >= INT_MAX / 2) {
+ av_log(s, AV_LOG_ERROR, "Bad seek table size\n");
+ return;
+ }
if(!(buf = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE)))
return;
avio_read(s->pb, buf, size);