Fixes: OOM Fixes: 3051/clusterfuzz-testcase-minimized-5745818336231424
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1302,6 +1302,15 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx, · 1301 unmodified lines | ||
| 1302 | 1302 | region_id = *buf++; |
| 1303 | 1303 | buf += 1; |
| 1304 | 1304 | |
| 1305 | + display = ctx->display_list; | |
| 1306 | + while (display && display->region_id != region_id) { | |
| 1307 | + display = display->next; | |
| 1308 | + } | |
| 1309 | + if (display) { | |
| 1310 | + av_log(avctx, AV_LOG_ERROR, "duplicate region\n"); | |
| 1311 | + break; | |
| 1312 | + } | |
| 1313 | + | |
| 1305 | 1314 | display = tmp_display_list; |
| 1306 | 1315 | tmp_ptr = &tmp_display_list; |
| 1307 | 1316 | |