aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Liberato <liberato@chromium.org>2017-01-24 10:58:17 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-03 15:59:14 +0100
commit44eaff5e6d659c4104b0be7ae7222e665666d315 (patch)
treeaa3e84efb3fa82064ff134234de239ee8c0fc54a
parentcfbab858094b134ed8750bae6d75a55425fd7ede (diff)
downloadffmpeg-44eaff5e6d659c4104b0be7ae7222e665666d315.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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index 46c51a6453..9553106f34 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) {