aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-13 01:20:19 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:11:55 +0200
commit09f8ed70770d0df6f3de9f922fd92a766c86645d (patch)
tree2238e32f5ca3dabe315814948df2999bd3dd3db3
parent804f68d91eaeed80494c6cef7e232e34fd873e6e (diff)
downloadffmpeg-09f8ed70770d0df6f3de9f922fd92a766c86645d.tar.gz
avformat/wtvdec: Avoid (32bit signed) sectors
Fixes: left shift of negative value -14614752 Fixes: 15174/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5670543606415360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit dd357d76e5faf3ce6fc46ffb924cf30f1cb54af9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/wtvdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 3ac4501306..0dd56f3692 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -149,7 +149,7 @@ static int read_ints(AVIOContext *pb, uint32_t *data, int count)
* @param depth File allocation table depth
* @return NULL on error
*/
-static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
+static AVIOContext * wtvfile_open_sector(unsigned first_sector, uint64_t length, int depth, AVFormatContext *s)
{
AVIOContext *pb;
WtvFile *wf;
@@ -957,7 +957,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
static int read_header(AVFormatContext *s)
{
WtvContext *wtv = s->priv_data;
- int root_sector, root_size;
+ unsigned root_sector;
+ int root_size;
uint8_t root[WTV_SECTOR_SIZE];
AVIOContext *pb;
int64_t timeline_pos;