aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-20 00:07:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:38 +0100
commit03ea84792af1521c08db1db203f174e2b3a6dde1 (patch)
treea1250e35e6b9f15444897d69956642789666539d /libavcodec
parent2d86e41d450c00956cc2d3fcedcd00a9d41e1005 (diff)
downloadffmpeg-03ea84792af1521c08db1db203f174e2b3a6dde1.tar.gz
avcodec/dvbsubdec: Use ff_set_dimensions()
Fixes: signed integer overflow: 65313 * 65313 cannot be represented in type 'int' Fixes: 15740/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVBSUB_fuzzer-5641749164195840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5941b7f615b0c0cab0d8f8613b918de75d3c1222) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index f329e05746..756e3a8e95 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1553,8 +1553,9 @@ static int dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
display_def->width = bytestream_get_be16(&buf) + 1;
display_def->height = bytestream_get_be16(&buf) + 1;
if (!avctx->width || !avctx->height) {
- avctx->width = display_def->width;
- avctx->height = display_def->height;
+ int ret = ff_set_dimensions(avctx, display_def->width, display_def->height);
+ if (ret < 0)
+ return ret;
}
if (info_byte & 1<<3) { // display_window_flag