diff options
author | Michael Niedermayer <[email protected]> | 2019-06-13 01:20:19 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2019-12-02 19:41:48 +0100 |
commit | 990753e81f2d3c369b262ec634b844e1b6908d23 (patch) | |
tree | 31b9d006e41e650928a1d8567df88730300440c5 | |
parent | 1bf0dd08c52636dab3dc8c7f19fe5db7a2da7547 (diff) |
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 <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit dd357d76e5faf3ce6fc46ffb924cf30f1cb54af9)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/wtvdec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index e8f6196a5e..af89c7b9d5 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -151,7 +151,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; @@ -961,7 +961,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; |