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
7070 if (avio_r8(pb))
7171 return AVERROR_INVALIDDATA;
7272 id = avio_rl32(pb);
73+ w->data_end = avio_tell(pb);
7374 if (avio_read(pb, data, sizeof(data)) != sizeof(data))
7475 return AVERROR(EIO);
76+ w->data_end += 16LL + AV_RL32(data + 4);
7577 fmt_len = AV_RL32(data + 32);
7678 if (fmt_len < 12)
7779 return AVERROR_INVALIDDATA;
@@ -98,8 +100,7 @@ static int wavarc_read_header(AVFormatContext *s) · 20 unmodified lines
98100 if (id != MKTAG('d','a','t','a'))
99101 avio_skip(pb, avio_rl32(pb));
100102 } while (id != MKTAG('d','a','t','a') && !avio_feof(pb));
101− w->data_end = avio_rl32(pb);
102− w->data_end += avio_tell(pb);
103+ avio_skip(pb, 4);
103104
104105 if (AV_RL32(par->extradata + 16) != MKTAG('R','I','F','F'))
105106 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