aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-22 20:05:53 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-22 20:08:55 +0200
commit557686ac6312ba59cc09fa023cf0f7a9f2c15a3f (patch)
tree9ddcdd0ff5d7349eabb2fe9cc1d6f09b27ba472b
parent86b252ea9dee18006910e30646ad1067f2d1323f (diff)
downloadffmpeg-557686ac6312ba59cc09fa023cf0f7a9f2c15a3f.tar.gz
avdevice/opengl_enc: check sscanf return value
-rw-r--r--libavdevice/opengl_enc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index 06750bbba1..88c413ee63 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -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 &&