Merge "get_ref_frame: fix test for valid buffer."