diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-10-29 16:39:13 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-10-29 17:39:26 +0100 |
commit | d4604d10fe728f3954b294c0a4373b6df65f4ec9 (patch) | |
tree | b308e4c0c8d6202bef12b74956599439ca9fcaff /libavutil/parseutils.c | |
parent | adf0cd1456801e3cd492865d5393dcc2a077edbd (diff) | |
download | ffmpeg-d4604d10fe728f3954b294c0a4373b6df65f4ec9.tar.gz |
lavu/parseutils: add trailing characters check in av_parse_video_size()
Return an error in case the video size specifications contains spurious
trailing chars, like in "320x240foobar".
Diffstat (limited to 'libavutil/parseutils.c')
-rw-r--r-- | libavutil/parseutils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index 0a7a6225db..a335978cc1 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -143,6 +143,10 @@ int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str) if (*p) p++; height = strtol(p, (void*)&p, 10); + + /* trailing extraneous data detected, like in 123x345foobar */ + if (*p) + return AVERROR(EINVAL); } if (width <= 0 || height <= 0) return AVERROR(EINVAL); |