Commit d59582a5 authored by Frank Liberato's avatar Frank Liberato Committed by Michael Niedermayer

avformat/flacdec: Check avio_read result when reading flac block header.

Return AVERROR_INVALIDDATA if all four bytes aren't present.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 95bde499)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 17a9e90d
......@@ -49,7 +49,8 @@ static int flac_read_header(AVFormatContext *s)
/* process metadata blocks */
while (!avio_feof(s->pb) && !metadata_last) {
avio_read(s->pb, header, 4);
if (avio_read(s->pb, header, 4) != 4)
return AVERROR(AVERROR_INVALIDDATA);
flac_parse_block_header(header, &metadata_last, &metadata_type,
&metadata_size);
switch (metadata_type) {
......
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