The church has historically taught there is "no salvation outside of the church." This is in accordance with the biblical doctrine that belief in Jesus is necessary for salvation and all believers are a part of the church.
The Roman Catholic Church has taken that to mean no salvation outside of belonging to them, since they are the one true church. Roman Catholics have also maintained over the years that the Church is infallible in its official decisions and teachings. (Although there is no list of infallible decisions and teachings.)
Over the years, the Roman church has changed its position on whether people outside of the Church can be saved. We will be looking at Unam Sanctum, a famous medieval papal pronouncement, and the modern Catechism to show clear changes in this teaching, and this impacts Roman Catholic claims of infallibility.
Full text here.
Urged by faith, we are obliged to believe and to maintain that the Church is one, holy, catholic, and also apostolic. We believe in her firmly and we confess with simplicity that outside of her there is neither salvation nor the remission of sins, as the Spouse in the Canticles [Sgs 6:8] proclaims: 'One is my dove, my perfect one. She is the only one, the chosen of her who bore her,' and she represents one sole mystical body whose Head is Christ and the head of Christ is God [1 Cor 11:3]. In her then is one Lord, one faith, one baptism [Eph 4:5]. There had been at the time of the deluge only one ark of Noah, prefiguring the one Church, which ark, having been finished to a single cubit, had only one pilot and guide, i.e., Noah, and we read that, outside of this ark, all that subsisted on the earth was destroyed.
We venerate this Church as one, the Lord having said by the mouth of the prophet: 'Deliver, O God, my soul from the sword and my only one from the hand of the dog.' [Ps 21:20] He has prayed for his soul, that is for himself, heart and body; and this body, that is to say, the Church, He has called one because of the unity of the Spouse, of the faith, of the sacraments, and of the charity of the Church. This is the tunic of the Lord, the seamless tunic, which was not rent but which was cast by lot [Jn 19:23-24]. Therefore, of the one and only Church there is one body and one head, not two heads like a monster; that is, Christ and the Vicar of Christ, Peter and the successor of Peter, since the Lord speaking to Peter Himself said: 'Feed my sheep' [Jn 21:17], meaning, my sheep in general, not these, nor those in particular, whence we understand that He entrusted all to him [Peter]. Therefore, if the Greeks or others should say that they are not confided to Peter and to his successors, they must confess not being the sheep of Christ, since Our Lord says in John 'there is one sheepfold and one shepherd.'
...
Furthermore, we declare, we proclaim, we define that it is absolutely necessary for salvation that every human creature be subject to the Roman Pontiff.
Cited texts can be found here.
838 "The Church knows that she is joined in many ways to the baptized who are honored by the name of Christian, but do not profess the Catholic faith in its entirety or have not preserved unity or communion under the successor of Peter."[322] Those "who believe in Christ and have been properly baptized are put in a certain, although imperfect, communion with the Catholic Church."[323] With the Orthodox Churches, this communion is so profound "that it lacks little to attain the fullness that would permit a common celebration of the Lord's Eucharist."[324]
841 The Church's relationship with the Muslims. "The plan of salvation also includes those who acknowledge the Creator, in the first place amongst whom are the Muslims; these profess to hold the faith of Abraham, and together with us they adore the one, merciful God, mankind's judge on the last day."[330]
There are many more sections which pertain to the growing inclusivist teachings within the Roman Catholic Church. For our purposes, I just want to point that these current teachings lay waste to any claims the Roman Church is infallible or has always been consistent in its teachings.
Unam Sanctum clearly states that Greeks (who were Eastern Orthodox) say they are not confided to Peter (they don't) or others (like Protestants or even non-Christians), they must confess not being the sheep of Christ. The Catechism holds out the posibility of salvation for Muslims and calls its unity with Orthodox Churches "profound." Muslims and Eastern Orthodox to do not claim to be "confided to Peter and to his successors."
Much more can be said about whether these positions are biblical or not. But we can at least say the Roman Catholic Church has contradicted previously taught doctrines. Therefore, claims of infalibility for the Church and the papacy also fall by the wayside.