diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-18 23:14:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-04-29 23:33:33 +0200 |
commit | aeb4e435847e0c970bcb1a835fe5eda17a4e1ce3 (patch) | |
tree | fa075bc072e4b4960baed69c135fb89c507c4a85 /libavcodec/txd.c | |
parent | 55e344ee5aa6f6e04e50bbac457e0ca53433ab75 (diff) | |
download | ffmpeg-aeb4e435847e0c970bcb1a835fe5eda17a4e1ce3.tar.gz |
avcodec/txd: Check for input size against the header size.
Fixes: Timeout (21sec -> 80ms)
Fixes: 20673/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TXD_fuzzer-5177453863763968
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/txd.c')
-rw-r--r-- | libavcodec/txd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 8b20475d39..f00ba89e82 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -43,6 +43,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int i, j; int ret; + if (avpkt->size < 88) + return AVERROR_INVALIDDATA; + ff_texturedsp_init(&dxtc); bytestream2_init(&gb, avpkt->data, avpkt->size); |