Message ID | 20200603231919.26199-3-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | bafaf95116b78ab58dbbcbf15f9c3a7c3a123fbd |
Headers | show |
Series | [FFmpeg-devel,1/3] avcodec/bitpacked: , | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On 6/3/20 4:19 PM, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: 22692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5678686190960640 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/wavpack.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c > index ead57063c8..f77548e5a5 100644 > --- a/libavcodec/wavpack.c > +++ b/libavcodec/wavpack.c > @@ -1129,6 +1129,9 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, > else > sample_fmt = AV_SAMPLE_FMT_S32P; > > + if (wc->ch_offset && avctx->sample_fmt != sample_fmt) > + return AVERROR_INVALIDDATA; > + > bpp = av_get_bytes_per_sample(sample_fmt); > orig_bpp = ((s->frame_flags & 0x03) + 1) << 3; > multiblock = (s->frame_flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK; Looks reasonable to me and passes my local test suite. Thanks! -David
On Thu, Jun 04, 2020 at 11:13:04AM -0700, David Bryant wrote: > On 6/3/20 4:19 PM, Michael Niedermayer wrote: > > Fixes: out of array access > > Fixes: 22692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5678686190960640 > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavcodec/wavpack.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c > > index ead57063c8..f77548e5a5 100644 > > --- a/libavcodec/wavpack.c > > +++ b/libavcodec/wavpack.c > > @@ -1129,6 +1129,9 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, > > else > > sample_fmt = AV_SAMPLE_FMT_S32P; > > > > + if (wc->ch_offset && avctx->sample_fmt != sample_fmt) > > + return AVERROR_INVALIDDATA; > > + > > bpp = av_get_bytes_per_sample(sample_fmt); > > orig_bpp = ((s->frame_flags & 0x03) + 1) << 3; > > multiblock = (s->frame_flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK; > > Looks reasonable to me and passes my local test suite. Thanks! will apply thx [...]
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index ead57063c8..f77548e5a5 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1129,6 +1129,9 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, else sample_fmt = AV_SAMPLE_FMT_S32P; + if (wc->ch_offset && avctx->sample_fmt != sample_fmt) + return AVERROR_INVALIDDATA; + bpp = av_get_bytes_per_sample(sample_fmt); orig_bpp = ((s->frame_flags & 0x03) + 1) << 3; multiblock = (s->frame_flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK;
Fixes: out of array access Fixes: 22692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVPACK_fuzzer-5678686190960640 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/wavpack.c | 3 +++ 1 file changed, 3 insertions(+)