You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
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 a8c5ae4511
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -1242,6 +1242,13 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
|||||||
display->y_pos = AV_RB16(buf) & 0xfff;
|
display->y_pos = AV_RB16(buf) & 0xfff;
|
||||||
buf += 2;
|
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) {
|
if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) {
|
||||||
display->fgcolor = *buf++;
|
display->fgcolor = *buf++;
|
||||||
display->bgcolor = *buf++;
|
display->bgcolor = *buf++;
|
||||||
|
Reference in New Issue
Block a user