diff options
author | Frank Liberato <liberato@chromium.org> | 2017-01-24 10:58:17 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-23 13:15:16 +0200 |
commit | 9b2591bc2d2ae8cb92b9b463e864892712843b14 (patch) | |
tree | 652a69dfa1bbd81e686cc09bd33192445e936228 | |
parent | 53c6a8d6efe2904f0aefbf5a866cc701dfc3fd96 (diff) | |
download | ffmpeg-9b2591bc2d2ae8cb92b9b463e864892712843b14.tar.gz |
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 95bde49982a82bc10470c0adab5969ffe635d064)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/flacdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index c291393954..b1a8d5a6cd 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -50,7 +50,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) { |