[FFmpeg-devel] [PATCH 1/4] avformat/vqf: Check avio_read() in add_metadata()

Michael Niedermayer michael at niedermayer.cc
Tue Dec 31 05:30:05 EET 2024


On Thu, Dec 26, 2024 at 11:39:10AM +0100, Marton Balint wrote:
> 
> 
> On Thu, 26 Dec 2024, Michael Niedermayer wrote:
> 
> > Fixes: use of uninitialized data
> > Fixes: 383825642/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5380168801124352
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> > libavformat/vqf.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/vqf.c b/libavformat/vqf.c
> > index 4820e0817c3..79deb33744b 100644
> > --- a/libavformat/vqf.c
> > +++ b/libavformat/vqf.c
> > @@ -63,7 +63,8 @@ static void add_metadata(AVFormatContext *s, uint32_t tag,
> >     buf = av_malloc(len+1);
> >     if (!buf)
> >         return;
> > -    avio_read(s->pb, buf, len);
> > +    if (len != avio_read(s->pb, buf, len))
> > +        return;
> 
> You should propagate error codes.

will post a seperate patch

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241231/30693676/attachment.sig>


More information about the ffmpeg-devel mailing list