The Megilla must be read from a parchment scroll, and those listening to the reading from a parchment scroll fulfill their obligation through their listening, even though they do not have a parchment scroll in front of them. If a person does not hear a word or several words of the Megilla, he should say those words and quickly catch up to the reader. As long as he hears the rest of the Megilla, he fulfills his obligation by reading the words which he missed. By the same token, if the reader notices that the Megilla he is using is missing several words, he may read those words from memory, and then both he and the listeners fulfill their obligation. Although the entire Megilla should be read from a parchment scroll, one nevertheless fulfills his obligation if he reads some of the Megilla from memory, as long as most of the Megilla was read from a scroll. As opposed to a Sefer Torah, which is invalid for use if it is missing even a single letter, a Megilla is valid even if it is missing some words, as long as the majority of the text is written. Therefore, if the reader knows from memory the missing words, he may say them from memory and his reading is then valid.
There is, however, one exception to this rule. The Rama (Rav Moshe Isserles of Cracow, 1525-1572) writes that if the first verse of the Megilla – "Va’yehi Bi’ymeh Ahashverosh" – or the last verse of the Megilla – "Ki Mordechai Ha’yehudi" – is missing, then the reading is not valid. Even though the reader knows the missing words by heart and says them correctly, the reading is invalid. However, Hacham Ovadia Yosef (Hazon Ovadia – Purim, p. 255) rules that this exception does not apply in the case where someone in the congregation did not hear the first or last Pasuk. In such a case, the person can read the words he missed from his text or from memory, just as he can if he missed any other words from the Megila. It is only if the first or last Pasuk is missing from the Megilla that the reading is invalid, because such a Megilla is not suitable for the Misva. But if somebody who is listening to the reading does not hear the first or last Pasuk, and he reads the missed words on his own, he has certainly fulfilled the Misva.
Summary: If a person listening to the Megilla does not hear several words, he should read those words from his text and thereby fulfills the Misva. Likewise, if the reader notices that some words are missing from his Megilla, he can say them from memory and he and his listeners fulfill the obligation. If, however, the Megilla is missing the first or last Pasuk, then the Megilla is disqualified for use.