avdevice/opengl_enc: check sscanf return value

This commit is contained in:
Paul B Mahol 2023-05-22 20:05:53 +02:00
parent 86b252ea9d
commit 557686ac63

View File

@ -594,7 +594,8 @@ static av_cold int opengl_read_limits(AVFormatContext *h)
}
av_log(h, AV_LOG_DEBUG, "OpenGL version: %s\n", version);
sscanf(version, "%d.%d", &major, &minor);
if (sscanf(version, "%d.%d", &major, &minor) != 2)
return AVERROR(ENOSYS);
for (i = 0; required_extensions[i].extension; i++) {
if (major < required_extensions[i].major &&