aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-08 15:04:25 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-11 16:28:34 +0100
commitb9f5a26a39efc0e49e2296306efde572630b1796 (patch)
tree6c4c8252de6c4f9d00d0ff31e5abdadeb7a1466d /libavcodec
parentcd693c9ec8a83eca7c5e79c454a451c7936749c5 (diff)
downloadffmpeg-b9f5a26a39efc0e49e2296306efde572630b1796.tar.gz
avcodec/movtextdec: Improve size check
Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/movtextdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 8dd571d64c..5083308d58 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -537,8 +537,8 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
m->size_var = 8;
//size_var is equal to 8 or 16 depending on the size of box
- if (tsmb_size == 0) {
- av_log(avctx, AV_LOG_ERROR, "tsmb_size is 0\n");
+ if (tsmb_size < m->size_var) {
+ av_log(avctx, AV_LOG_ERROR, "tsmb_size invalid\n");
return AVERROR_INVALIDDATA;
}