summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-22 03:31:49 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-25 23:38:24 +0200
commit7c10068da10aa288195f5eb5d7e34eb2d8ff7447 (patch)
treefee27aab58a799863230cf5696c2f1d25b40c7fb /libavcodec
parent8a0954dd51ca5c8f8e1c6d2c2d0961ae24055814 (diff)
avcodec/dvbsubdec: Check for duplicate regions in dvbsub_parse_page_segment()
Fixes: OOM Fixes: 3051/clusterfuzz-testcase-minimized-5745818336231424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 98619f9631..b683109643 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1302,6 +1302,15 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx,
region_id = *buf++;
buf += 1;
+ display = ctx->display_list;
+ while (display && display->region_id != region_id) {
+ display = display->next;
+ }
+ if (display) {
+ av_log(avctx, AV_LOG_ERROR, "duplicate region\n");
+ break;
+ }
+
display = tmp_display_list;
tmp_ptr = &tmp_display_list;