summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d193f9e85f..8ac6bc04b8 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4700,8 +4700,11 @@ int av_get_frame_filename2(char *buf, int buf_size, const char *path, int number
if (c == '%') {
do {
nd = 0;
- while (av_isdigit(*p))
+ while (av_isdigit(*p)) {
+ if (nd >= INT_MAX / 10 - 255)
+ goto fail;
nd = nd * 10 + *p++ - '0';
+ }
c = *p++;
} while (av_isdigit(c));