Jagged edges on H264 image decoder

Hi, I am currently writing an app to use the NvMediaImageDecoder on ROS, and while the decoder is able to receive frames and decoder, the video output has jagged edges whenever there are large changes to the previous frame. The fps of the decoder has been set to that of the encoder, as well as the bitrate. Are there any possible reasons for why there would be jagged edges, and could the decoder be dropping frames?

In addition, whenever the buffer size is set to more than 1 (ctx->nBuffers > 1 parameter in the Nvmedia img_play.c sample), it was observed that a sequence of frames would loop several times before playing the next frame (in which another sequence of frames would loop). Hence, the video would not play in sequence and we would see continuous rewinding. Does this have to do with the buffer size of the decoder?