diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-07-22 20:45:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-10-28 02:22:42 +0200 |
commit | 7068bcf58ad2ad8190ce343934503dd1f0b98ee4 (patch) | |
tree | 29e6e6b5be0b2852c52ef147f093c8b93ebc5de0 | |
parent | 330ed0772c6f6f36e9a027757f393a2886e44c55 (diff) | |
download | ffmpeg-7068bcf58ad2ad8190ce343934503dd1f0b98ee4.tar.gz |
avcodec/diracdec: Change frame_number to 64bit as its a 32bit from the bitstream and we also have a -1 special case
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 9291/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-6324345860259840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 462d1be6dec5ff4768be8c202f359cbf037db3c6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/diracdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 98474eaf50..376732c310 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -140,7 +140,7 @@ typedef struct DiracContext { GetBitContext gb; AVDiracSeqHeader seq; int seen_sequence_header; - int frame_number; /* number of the next frame to display */ + int64_t frame_number; /* number of the next frame to display */ Plane plane[3]; int chroma_x_shift; int chroma_y_shift; @@ -2302,7 +2302,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } if (*got_frame) - s->frame_number = picture->display_picture_number + 1; + s->frame_number = picture->display_picture_number + 1LL; return buf_idx; } |