Hi Michael! On 2024-12-31 04:36 +0100, Michael Niedermayer wrote: > Suggested-by: Marton Balint <c...@passwd.hu> > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > --- > libavformat/vqf.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/libavformat/vqf.c b/libavformat/vqf.c > index 79deb33744b..5094724240e 100644 > --- a/libavformat/vqf.c > +++ b/libavformat/vqf.c > @@ -51,23 +51,24 @@ static int vqf_probe(const AVProbeData *probe_packet) > return AVPROBE_SCORE_EXTENSION; > } > > -static void add_metadata(AVFormatContext *s, uint32_t tag, > +static int add_metadata(AVFormatContext *s, uint32_t tag, > unsigned int tag_len, unsigned int remaining) > { > int len = FFMIN(tag_len, remaining); > char *buf, key[5] = {0}; > > if (len == UINT_MAX) > - return; > + return AVERROR(ENOMEM); > > buf = av_malloc(len+1); > if (!buf) > - return; > + return AVERROR(ENOMEM); > if (len != avio_read(s->pb, buf, len)) > - return; > + return len < 0 ? len : AVERROR_INVALIDDATA;
This looks wrong if I understood this function correctly. The variable *len* is only set at the beginning of the function. If I understand the intent correctly we should either always return AVERROR_INVALIDDATA or we should store the return value of avio_read and return that if it's negative. [...] Alexander _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".