Commit 0382c94f authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

id3v2: catch avio_read errors in check_tag

Since len is an unsigned int, the comparison is currently treated as
unsigned and thus ignores all errors from avio_read.

Thus cast len to int, which is unproblematic, because at that point len
is between 0 and 4.

This fixes 'Conditional jump or move depends on uninitialised value'
valgrind warnings in is_tag.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ae4eea8b
......@@ -205,7 +205,7 @@ static int check_tag(AVIOContext *s, int offset, unsigned int len)
if (len > 4 ||
avio_seek(s, offset, SEEK_SET) < 0 ||
avio_read(s, tag, len) < len)
avio_read(s, tag, len) < (int)len)
return -1;
else if (!AV_RB32(tag) || is_tag(tag, len))
return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment