mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avdevice/xcbgrab: Check sscanf() return
Alot more input checking can be performed, this is only checking the obvious missing case
Fixes: CID1598562 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 78d6d13bab
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9b28c8b9e9
commit
482de477e3
@ -826,7 +826,10 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
|
||||
|
||||
if (!sscanf(s->url, "%[^+]+%d,%d", display_name, &c->x, &c->y)) {
|
||||
*display_name = 0;
|
||||
sscanf(s->url, "+%d,%d", &c->x, &c->y);
|
||||
if(sscanf(s->url, "+%d,%d", &c->x, &c->y) != 2) {
|
||||
if (*s->url)
|
||||
av_log(s, AV_LOG_WARNING, "Ambigous URL: %s\n", s->url);
|
||||
}
|
||||
}
|
||||
|
||||
c->conn = xcb_connect(display_name[0] ? display_name : NULL, &screen_num);
|
||||
|
Loading…
Reference in New Issue
Block a user