History

avdevice/lavfi: check that pointer is set

Fixes NULL pointer dereference later.

Paul B Mahol committed 3 years ago

Commit 5ce76501 parent dc1d4a81 file · +4 −0Browse files

Unified · Split

libavdevice/lavfi.c+4−0
@@ -174,6 +174,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) · 173 unmodified lines
174174 * create a mapping between them and the streams */
175175 for (i = 0, inout = output_links; inout; i++, inout = inout->next) {
176176 int stream_idx = 0, suffix = 0, use_subcc = 0;
177+ if (!inout->name) {
178+ av_log(avctx, AV_LOG_ERROR, "Missing %d outpad name\n", i);
179+ FAIL(AVERROR(EINVAL));
180+ }
177181 sscanf(inout->name, "out%n%d%n", &suffix, &stream_idx, &suffix);
178182 if (!suffix) {
179183 av_log(avctx, AV_LOG_ERROR,

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