The limit is based on hevcdec.c Fixes: 20854/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_METADATA_fuzzer-5160442882424832 Fixes: out of array access
Unified · Split
| @@ -1377,7 +1377,7 @@ static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw, · 1376 unmodified lines | |||
| 1377 | infer(num_long_term_sps, 0); | 1377 | infer(num_long_term_sps, 0); |
| 1378 | idx_size = 0; | 1378 | idx_size = 0; |
| 1379 | } | 1379 | } |
| 1380 | ue(num_long_term_pics, 0, HEVC_MAX_LONG_TERM_REF_PICS); | 1380 | ue(num_long_term_pics, 0, HEVC_MAX_REFS - current->num_long_term_sps); |
| 1381 | 1381 | ||
| 1382 | for (i = 0; i < current->num_long_term_sps + | 1382 | for (i = 0; i < current->num_long_term_sps + |
| 1383 | current->num_long_term_pics; i++) { | 1383 | current->num_long_term_pics; i++) { |