aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-03-05 20:14:05 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-21 10:42:52 +0100
commit86af0e2a87321663b6c6f5538017dcb1726400c1 (patch)
tree6bb5b2b4c1876c59423d488b49af3f5da4c115db /libavcodec
parent09b6cce9ba4935b9c50f7ca2aad1ed83c7ca6c38 (diff)
downloadffmpeg-86af0e2a87321663b6c6f5538017dcb1726400c1.tar.gz
avcodec/dvbsubdec: Check object position
Reference: ETSI EN 300 743 V1.2.1 7.2.2 Region composition segment Fixes: Timeout Fixes: 13325/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-5143979392237568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a8c5ae451184e879fc8ff1333c6f26f9542c8ebf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index a657b1d3d0..6af6ef7b70 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1261,6 +1261,13 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
display->y_pos = AV_RB16(buf) & 0xfff;
buf += 2;
+ if (display->x_pos >= region->width ||
+ display->y_pos >= region->height) {
+ av_log(avctx, AV_LOG_ERROR, "Object outside region\n");
+ av_free(display);
+ return AVERROR_INVALIDDATA;
+ }
+
if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) {
display->fgcolor = *buf++;
display->bgcolor = *buf++;