History

lavd/opengl_enc: check strings before parsing them.

Fix a segfault if OpenGL was not initialized before calling write_header().

Nicolas George committed 6 years ago

Commit 26ae9c91 parent fbb36d71 file · +4 −0Browse files

Unified · Split

libavdevice/opengl_enc.c+4−0
@@ -588,6 +588,10 @@ static av_cold int opengl_read_limits(AVFormatContext *h) · 587 unmodified lines
588588
589589 version = glGetString(GL_VERSION);
590590 extensions = glGetString(GL_EXTENSIONS);
591+ if (!version || !extensions) {
592+ av_log(h, AV_LOG_ERROR, "No OpenGL context initialized for the current thread\n");
593+ return AVERROR(ENOSYS);
594+ }
591595
592596 av_log(h, AV_LOG_DEBUG, "OpenGL version: %s\n", version);
593597 sscanf(version, "%d.%d", &major, &minor);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t