History

avformat/wavarc: fix data end calculation

Paul B Mahol committed 3 years ago

Commit fb06a441 parent fc993e71 file · +3 −2Browse files

Unified · Split

libavformat/wavarc.c+3−2
@@ -70,8 +70,10 @@ static int wavarc_read_header(AVFormatContext *s) · 69 unmodified lines
70 if (avio_r8(pb))70 if (avio_r8(pb))
71 return AVERROR_INVALIDDATA;71 return AVERROR_INVALIDDATA;
72 id = avio_rl32(pb);72 id = avio_rl32(pb);
73 w->data_end = avio_tell(pb);
73 if (avio_read(pb, data, sizeof(data)) != sizeof(data))74 if (avio_read(pb, data, sizeof(data)) != sizeof(data))
74 return AVERROR(EIO);75 return AVERROR(EIO);
76 w->data_end += 16LL + AV_RL32(data + 4);
75 fmt_len = AV_RL32(data + 32);77 fmt_len = AV_RL32(data + 32);
76 if (fmt_len < 12)78 if (fmt_len < 12)
77 return AVERROR_INVALIDDATA;79 return AVERROR_INVALIDDATA;
@@ -98,8 +100,7 @@ static int wavarc_read_header(AVFormatContext *s) · 20 unmodified lines
98 if (id != MKTAG('d','a','t','a'))100 if (id != MKTAG('d','a','t','a'))
99 avio_skip(pb, avio_rl32(pb));101 avio_skip(pb, avio_rl32(pb));
100 } while (id != MKTAG('d','a','t','a') && !avio_feof(pb));102 } while (id != MKTAG('d','a','t','a') && !avio_feof(pb));
101 w->data_end = avio_rl32(pb);103 avio_skip(pb, 4);
102 w->data_end += avio_tell(pb);
103 104
104 if (AV_RL32(par->extradata + 16) != MKTAG('R','I','F','F'))105 if (AV_RL32(par->extradata + 16) != MKTAG('R','I','F','F'))
105 return AVERROR_INVALIDDATA;106 return AVERROR_INVALIDDATA;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t