[FFmpeg-cvslog] avdevice/opengl_enc: check sscanf return value
Paul B Mahol
git at videolan.org
Mon May 22 21:04:10 EEST 2023
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May 22 20:05:53 2023 +0200| [557686ac6312ba59cc09fa023cf0f7a9f2c15a3f] | committer: Paul B Mahol
avdevice/opengl_enc: check sscanf return value
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=557686ac6312ba59cc09fa023cf0f7a9f2c15a3f
---
libavdevice/opengl_enc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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 &&
More information about the ffmpeg-cvslog
mailing list