[FFmpeg-devel] [PATCH 2/2] libavformat/takdec.c: Fix msan error.

Nicolas George george at nsup.org
Mon Apr 21 20:00:49 EEST 2025


Thierry Foucu (HE12025-04-21):
> > >> -            avio_read(pb, md5, 16);
> > >> +            if (avio_read(pb, md5, 16) != 16) {
> > >> +                return AVERROR(EIO);
> > Should be AVERROR_INVALIDDATA imo, since i means the file is just
> > truncated. It wasn't an error in the protocol reading data.
> Regarding the error message, I was trying to be consistent with the other
> avio_read error, like here:
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/takdec.c#L99

Both codes are wrong: if avio_read() returns an error, it must be
returned as is, not a new error invented.

And if avio_read() returns less than requested, then I agree with James,
INVALID_DATA is more correct than EIO. In both places.

Regards,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list