Browse Source

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

Return AVERROR_INVALIDDATA if all four bytes aren't present.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 95bde49982)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.3
Frank Liberato Michael Niedermayer 9 years ago
parent
commit
cc66247603
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/flacdec.c

+ 2
- 1
libavformat/flacdec.c View File

@@ -65,7 +65,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) {


Loading…
Cancel
Save