Fixes NULL pointer dereference later.
Unified · Split
| @@ -174,6 +174,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) · 173 unmodified lines | |||
| 174 | * create a mapping between them and the streams */ | 174 | * create a mapping between them and the streams */ |
| 175 | for (i = 0, inout = output_links; inout; i++, inout = inout->next) { | 175 | for (i = 0, inout = output_links; inout; i++, inout = inout->next) { |
| 176 | int stream_idx = 0, suffix = 0, use_subcc = 0; | 176 | 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 | } | ||
| 177 | sscanf(inout->name, "out%n%d%n", &suffix, &stream_idx, &suffix); | 181 | sscanf(inout->name, "out%n%d%n", &suffix, &stream_idx, &suffix); |
| 178 | if (!suffix) { | 182 | if (!suffix) { |
| 179 | av_log(avctx, AV_LOG_ERROR, | 183 | av_log(avctx, AV_LOG_ERROR, |