Commit d4604d10 authored by Stefano Sabatini's avatar Stefano Sabatini

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".
parent adf0cd14
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment