Message ID | 20180103224201.18317-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | b2be76c0a472b729756ed7a91225c209d0dd1d2e |
Headers | show |
On 1/3/18, Michael Niedermayer <michael@niedermayer.cc> wrote: > Fixes: signed integer overflow: 1024 + 2147483640 cannot be represented in > type 'int' > Fixes: 4671/clusterfuzz-testcase-minimized-6027464343027712 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/dnxhddec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > lgtm
On Thu, Jan 04, 2018 at 10:08:08AM +0100, Paul B Mahol wrote: > On 1/3/18, Michael Niedermayer <michael@niedermayer.cc> wrote: > > Fixes: signed integer overflow: 1024 + 2147483640 cannot be represented in > > type 'int' > > Fixes: 4671/clusterfuzz-testcase-minimized-6027464343027712 > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavcodec/dnxhddec.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > lgtm will apply thx [...]
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 05f4458f99..11d0bf424a 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -383,6 +383,10 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, UPDATE_CACHE(bs, &row->gb); GET_VLC(len, bs, &row->gb, ctx->dc_vlc.table, DNXHD_DC_VLC_BITS, 1); + if (len < 0) { + ret = len; + goto error; + } if (len) { level = GET_CACHE(bs, &row->gb); LAST_SKIP_BITS(bs, &row->gb, len); @@ -436,7 +440,7 @@ static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, GET_VLC(index1, bs, &row->gb, ctx->ac_vlc.table, DNXHD_VLC_BITS, 2); } - +error: CLOSE_READER(bs, &row->gb); return ret; }
Fixes: signed integer overflow: 1024 + 2147483640 cannot be represented in type 'int' Fixes: 4671/clusterfuzz-testcase-minimized-6027464343027712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/dnxhddec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)