diff options
author | Frank Liberato <liberato@chromium.org> | 2017-01-24 10:58:17 -0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-01-26 00:34:13 +0100 |
commit | cc662476031b168a398d48fa6c6fc4a5f08fe4fa (patch) | |
tree | 4c94889183a7c77acb6443c3843bec6ac2d78fdf | |
parent | dc2d3856f300dfd215ea5c8fb90bb4a628e829a4 (diff) | |
download | ffmpeg-cc662476031b168a398d48fa6c6fc4a5f08fe4fa.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 3060dc45fd..66baba5922 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -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) { |