diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 130b81ebbe..bec4ad7cec 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -567,7 +567,8 @@ static int viv_read_header(AVFormatContext *s) v = avio_r8(pb); avio_seek(pb, v, SEEK_CUR); - avio_read(pb, keybuffer, 187); + if (avio_read(pb, keybuffer, 187) != 187) + return AVERROR_INVALIDDATA; key = decode_key(keybuffer); viv->sb_key = key;