Message ID | 20240806221853.959177-6-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/6] avformat/segafilm: Set keyframe | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
On Wed, Aug 07, 2024 at 12:18:53AM +0200, Michael Niedermayer wrote: > Fixes: Use of uninitialized value > Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/wtvdec.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c > index 1a6c4c33481..730c7fca783 100644 > --- a/libavformat/wtvdec.c > +++ b/libavformat/wtvdec.c > @@ -846,7 +846,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p > } > > buf_size = FFMIN(len - consumed, sizeof(buf)); > - avio_read(pb, buf, buf_size); > + if (avio_read(pb, buf, buf_size) != buf_size) > + return AVERROR_INVALIDDATA; > consumed += buf_size; > ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL); > } please apply -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
On Wed, Aug 07, 2024 at 10:02:09AM +1000, Peter Ross wrote: > On Wed, Aug 07, 2024 at 12:18:53AM +0200, Michael Niedermayer wrote: > > Fixes: Use of uninitialized value > > Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976 > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavformat/wtvdec.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c > > index 1a6c4c33481..730c7fca783 100644 > > --- a/libavformat/wtvdec.c > > +++ b/libavformat/wtvdec.c > > @@ -846,7 +846,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p > > } > > > > buf_size = FFMIN(len - consumed, sizeof(buf)); > > - avio_read(pb, buf, buf_size); > > + if (avio_read(pb, buf, buf_size) != buf_size) > > + return AVERROR_INVALIDDATA; > > consumed += buf_size; > > ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL); > > } > > please apply will apply thx [...]
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 1a6c4c33481..730c7fca783 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -846,7 +846,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p } buf_size = FFMIN(len - consumed, sizeof(buf)); - avio_read(pb, buf, buf_size); + if (avio_read(pb, buf, buf_size) != buf_size) + return AVERROR_INVALIDDATA; consumed += buf_size; ff_parse_mpeg2_descriptor(s, st, 0, &pbuf, buf + buf_size, NULL, 0, 0, NULL); }
Fixes: Use of uninitialized value Fixes: 70900/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6286909377150976 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/wtvdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)