cuvidParseVideoData - when do I know provided data is corrupt?

Sometimes data that I pass to cuvidParseVideoData are corrupt. Because, for instance, over the network a frame or two got lost and the decoder is supposed to decode frame n data without having first decompressed frames n-1, n-2, … How do I detect if the provided data is incorrect/corrupt?
FFmpeg on such occasions returns an error upon call to avcodec_receive_frame