[FFmpeg-devel] [PATCH 4/4] avformat/mlvdec: Check avio_read()
Michael Niedermayer
michael at niedermayer.cc
Tue Dec 31 04:51:37 EET 2024
On Thu, Dec 26, 2024 at 12:28:16PM +1100, Peter Ross wrote:
> On Wed, Dec 25, 2024 at 05:26:57AM +0100, Michael Niedermayer wrote:
> > Fixes: use-of-uninitialized-value
> > Fixes: 383170476/clusterfuzz-testcase-minimized-ffmpeg_dem_MLV_fuzzer-4696002884337664
> >
> > 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/mlvdec.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
> > index 1a6d38f37cb..985365326e8 100644
> > --- a/libavformat/mlvdec.c
> > +++ b/libavformat/mlvdec.c
> > @@ -82,13 +82,15 @@ static int check_file_header(AVIOContext *pb, uint64_t guid)
> > static void read_string(AVFormatContext *avctx, AVIOContext *pb, const char *tag, unsigned size)
> > {
> > char * value = av_malloc(size + 1);
> > + int ret;
> > +
> > if (!value) {
> > avio_skip(pb, size);
> > return;
> > }
> >
> > - avio_read(pb, value, size);
> > - if (!value[0]) {
> > + ret = avio_read(pb, value, size);
> > + if (ret != size || !value[0]) {
> > av_free(value);
> > return;
> > }
>
> please apply
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown
-------------- 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/f4f884fc/attachment.sig>
More information about the ffmpeg-devel
mailing list