diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c index 4075897b9a..aecc4d79f8 100644 --- a/libavcodec/cbs_h266_syntax_template.c +++ b/libavcodec/cbs_h266_syntax_template.c @@ -891,6 +891,8 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw, } } } + if (!num_output_layers_in_ols[i]) + return AVERROR_INVALIDDATA; } for (i = 1; i < total_num_olss; i++) { int num_layers_in_ols = 0;